How can I convert a COleDateTime::GetCurrentTime() to a unix time stamp or more specifically I want to convert the value so I can use it in PHP with the date() function?
How can I convert a COleDateTime::GetCurrentTime() to a unix time stamp or more specifically
Share
That sounds like the DATE type:
test code:
prints
40224.000000.I don’t think there is a built-in function to convert this back to any “native” php date/time value (could be wrong though).
edit: A (probably naive) starting point for a conversion function…
some sample data create by
lead to
which prints
Though these 9 samples seem to work ok I’m not sure about intval()/round() and whether there are other conventions the php code must follow. If you’re going to use this function, test it And then test it again with a lot more samples.
And keep in mind that this is limited to the unix timestamp range which is smaller than the range of COleDateTime.