Go Back   SitePoint Forums > Forum Index > Program Your Site > PHP
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
Reply
 
Thread Tools Display Modes
Old Nov 22, 2009, 14:59   #1
yoyo_rw
SitePoint Member
 
Join Date: Apr 2005
Posts: 19
Convert .NET DateTime.Ticks

Is there a way to convert .NET DateTime.Ticks to UTC using PHP?
yoyo_rw is offline   Reply With Quote
Old Nov 22, 2009, 15:02   #2
Shrapnel_N5
SitePoint Wizard
 
Shrapnel_N5's Avatar
 
Join Date: Oct 2009
Posts: 1,425
multiply by 1000000
Shrapnel_N5 is online now   Reply With Quote
Old Nov 22, 2009, 15:14   #3
yoyo_rw
SitePoint Member
 
Join Date: Apr 2005
Posts: 19
The value of this property represents the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight, January 1, 0001

This is how the value actually looks like 633943144490000000
yoyo_rw is offline   Reply With Quote
Old Nov 22, 2009, 23:06   #4
Shrapnel_N5
SitePoint Wizard
 
Shrapnel_N5's Avatar
 
Join Date: Oct 2009
Posts: 1,425
oh, yeah. divide it I mean. by 1000000
and then convert to unix timestamp
which is number of seconds elapsed since 12:00:00 midnight, January 1, 1970
Shrapnel_N5 is online now   Reply With Quote
Old Nov 23, 2009, 01:01   #5
AnthonySterling
Twitter: @AnthonySterling
 
AnthonySterling's Avatar
 
Join Date: Apr 2008
Location: North-East, UK.
Posts: 3,274
With numbers of this size, it might be worth noting that the math extensions BC and GMP may come in handy.
AnthonySterling is online now   Reply With Quote
Reply

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
Display Modes

 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 04:05.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved