I need to get a datetime format of yyyy-MM-ddTHH:mm:ss.fffZ
to use in creating a hash to talk with a .NET server. How can I get that format in PHP? I don't know what "fffZ" even is to try to figure this out myself and can't find it online. Help is greatly appreciated.
Thanks, James
See Custom Date and Time Format Strings
and
To get the corresponding format in PHP, see
date
..fffZ
refer to milliseconds and the timezone..fff
specifies 3 decimal places of milliseconds.Z
is the timezone (+0000 UTC e.t.c).You may find this page useful: link
Using PHP you can get it in this way:
You can find each character at the documentation. Although I'm not sure if the
Z
means the same in both languages.According to MSDN, fff is milliseconds:
http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
Z is going to be timezone. You can handle getting that in PHP by http://php.net/manual/en/datetime.gettimezone.php.
The rest should be pretty straight forward.
Edit: Actually, forgot that Z in .NET is going to be offset from UTC. Seems like you can get that from something similar to UTC Offset in PHP.