|
of_convertpbdatetimetofile
|
|
Full name
|
pfc_n_cst_filesrvwin32.of_convertpbdatetimetofile
|
Access
|
protected
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_convertpbdatetimetofile(date,time,ref os_filedatetime)
|
Name
|
Datatype
|
ls_Time
|
string
|
lstr_LocalTime
|
os_filedatetime
|
lstr_SystemTime
|
os_systemtime
|
lui_test
|
unsignedinteger
|
lui_year
|
unsignedinteger
|
protected function integer of_convertpbdatetimetofile (date ad_filedate, time at_filetime, ref os_filedatetime astr_filetime);//////////////////////////////////////////////////////////////////////////////
// Protected Function: of_ConvertPBDatetimeToFile
// Arguments: ad_FileDate The file date in PowerBuilder Date format.
// at_FileTime The file time in PowerBuilder Time format.
// astr_FileTime The os_filedatetime structure to contain the
// system date/time for the file, passed by reference.
// Returns: Integer
// 1 if successful, -1 if an error occurrs.
// Description: Convert PowerBuilder Date and Time to the sytem file type.
//////////////////////////////////////////////////////////////////////////////
// Rev. History: Version
// 5.0 Initial version
// 5.0.03 Fix problem with century not being on the year passed in
// 6.0.01 Fix millisecond overflow. Change size of string to 3 digits from 6
//////////////////////////////////////////////////////////////////////////////
// Copyright © 1996-1999 Sybase, Inc. and its subsidiaries. All rights reserved. Any distribution of the
// PowerBuilder Foundation Classes (PFC) source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//////////////////////////////////////////////////////////////////////////////
string ls_Time
unsignedinteger lui_year, lui_test
os_filedatetime lstr_LocalTime
os_systemtime lstr_SystemTime
// fix problem when year without century passed in
lui_year = Integer(String(ad_FileDate,'yyyy'))
lui_test = Year(ad_filedate)
if lui_year < 50 then
lui_year = lui_year + 2000
elseif lui_year < 100 then
lui_year = lui_year + 1900
end if
// make sure year with century is passed in
lstr_SystemTime.ui_wyear = lui_year
lstr_SystemTime.ui_WMonth = month(ad_FileDate)
lstr_SystemTime.ui_WDay = day(ad_FileDate)
ls_Time = String(at_FileTime, "hh:mm:ss:fff")
lstr_SystemTime.ui_wHour = Long(Left(ls_Time, 2))
lstr_SystemTime.ui_wMinute = Long(Mid(ls_Time, 4, 2))
lstr_SystemTime.ui_wSecond = Long(Mid(ls_Time, 7, 2))
lstr_SystemTime.ui_wMilliseconds = Long(Right(ls_Time, 3))
If Not SystemTimeToFileTime(lstr_SystemTime, lstr_LocalTime) Then Return -1
If Not LocalFileTimeToFileTime(lstr_LocalTime, astr_FileTime) Then Return -1
Return 1
end function
Name
|
Owner
|
systemfunctions.day |
systemfunctions
|
systemfunctions.integer |
systemfunctions
|
systemfunctions.left |
systemfunctions
|
systemfunctions.long |
systemfunctions
|
systemfunctions.mid |
systemfunctions
|
systemfunctions.month |
systemfunctions
|
systemfunctions.right |
systemfunctions
|
systemfunctions.string |
systemfunctions
|
systemfunctions.year |
systemfunctions
|
pfc_n_cst_filesrvwin32.SystemTimeToFileTime |
pfc_n_cst_filesrvwin32
|
pfc_n_cst_filesrvwin32.LocalFileTimeToFileTime |
pfc_n_cst_filesrvwin32
|