Reputation: 2177
I have this date returned from payment gateway
2014-05-15T08:40:52+01:00
I got 2014-05-15T08:40:52 but i am unable to identify meaning of timezone +01:00
My location timezone is UTC−06:00 (CT)
Servers location time zone is UTC−02:00
My payment gateway time zone UTC−05:00 (EST)
What is the meaning of +01:00
after adding/without adding it to my timezones? How can i tell to my website user that he/she successfully completed payment process at XX date and Time...
Upvotes: 2
Views: 1586
Reputation: 46910
The formats are as follows. Exactly the components shown here must be present, with exactly this punctuation. Note that the "T" appears literally in the string, to indicate the beginning of the time element, as specified in ISO 8601.
Year:
YYYY (eg 1997)
Year and month:
YYYY-MM (eg 1997-07)
Complete date:
YYYY-MM-DD (eg 1997-07-16)
Complete date plus hours and minutes:
YYYY-MM-DDThh:mmTZD (eg 1997-07-16T19:20+01:00)
Complete date plus hours, minutes and seconds:
YYYY-MM-DDThh:mm:ssTZD (eg 1997-07-16T19:20:30+01:00)
Complete date plus hours, minutes, seconds and a decimal fraction of a second
YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)
where:
YYYY = four-digit year
MM = two-digit month (01=January, etc.)
DD = two-digit day of month (01 through 31)
hh = two digits of hour (00 through 23) (am/pm NOT allowed)
mm = two digits of minute (00 through 59)
ss = two digits of second (00 through 59)
s = one or more digits representing a decimal fraction of a second
TZD = time zone designator (Z or +hh:mm or -hh:mm)
This profile defines two ways of handling time zone offsets:
1.Times are expressed in UTC (Coordinated Universal Time), with a special UTC designator ("Z").
2.Times are expressed in local time, together with a time zone offset in hours and minutes.
A time zone offset of "+hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes ahead of UTC.
A time zone offset of "-hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes behind UTC.
This section answers your question
A time zone offset of "+hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes ahead of UTC.
TL;DR
The date that you are seeing is in a Time Zone 1 hour ahead of UTC, regardless of what time is it at your server and what time is it at the payment gateway. The time that it did return is 1 hour ahead of UTC which stands anywhere in the world and in any time zone.
Upvotes: 3