PowerBuilder
PowerBuilder
DateTime - Get as Unix Time String
Demonstrates the GetAsUnixTimeStr method.Note: This example is only valid in Chilkat v9.5.0.65 or later.
Chilkat PowerBuilder Downloads
integer li_rc
oleobject loo_DateTime
integer li_BLocal
loo_DateTime = create oleobject
li_rc = loo_DateTime.ConnectToNewObject("Chilkat.CkDateTime")
if li_rc < 0 then
destroy loo_DateTime
MessageBox("Error","Connecting to COM object failed")
return
end if
loo_DateTime.SetFromCurrentSystemTime()
// (in seconds since the epoch: 00:00:00 UTC on 1 January 1970)
li_BLocal = 1
Write-Debug "Unix time: " + loo_DateTime.GetAsUnixTimeStr(li_BLocal)
// Sample output for test run on 2-Dec-2016:
// Unix time: 1480661608
destroy loo_DateTime