|
of_ConvertFileDatetimeToPB
|
|
Full name
|
pfc_n_cst_filesrvaix.of_ConvertFileDatetimeToPB
|
Access
|
protected
|
Extend of
|
integer
|
Return value
|
integer
|
Prototype
|
protected function integer of_ConvertFileDatetimeToPB(os_filedatetime,ref date,ref time)
|
Name
|
Datatype
|
ls_Date
|
string
|
ls_Time
|
string
|
lstr_LocalTime
|
os_filedatetime
|
lstr_SystemTime
|
os_systemtime
|
protected function integer of_ConvertFileDatetimeToPB (os_filedatetime astr_filetime, ref date ad_filedate, ref time at_filetime);//////////////////////////////////////////////////////////////////////////////
// Protected Function: of_ConvertFileDatetimeToPB
// Arguments: astr_FileTime The os_filedatetime structure containing the system date/time for the file.
// ad_FileDate The file date in PowerBuilder Date format, passed by reference.
// at_FileTime The file time in PowerBuilder Time format, passed by reference.
// Returns: Integer
// 1 if successful, -1 if an error occurrs.
// Description: Convert a system file type to PowerBuilder Date and Time.
//////////////////////////////////////////////////////////////////////////////
// Rev. History: Version
// 6.0 Initial version
//////////////////////////////////////////////////////////////////////////////
// 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_Date, ls_Time
os_filedatetime lstr_LocalTime
os_systemtime lstr_SystemTime
If Not FileTimeToLocalFileTime(astr_FileTime, lstr_LocalTime) Then Return -1
If Not FileTimeToSystemTime(lstr_LocalTime, lstr_SystemTime) Then Return -1
ls_Date = String(lstr_SystemTime.ui_WMonth) + "/" + &
String(lstr_SystemTime.ui_WDay) + "/" + &
String(lstr_SystemTime.ui_wyear)
ad_FileDate = Date(ls_Date)
ls_Time = String(lstr_SystemTime.ui_wHour) + ":" + &
String(lstr_SystemTime.ui_wMinute) + ":" + &
String(lstr_SystemTime.ui_wSecond) + ":" + &
String(lstr_SystemTime.ui_wMilliseconds)
at_FileTime = Time(ls_Time)
Return 1
end function