I'm looking at the PayPal IPN docs
, and it says the datetime
stamps of their strings are formatted as:
我正在查看PayPal IPN文档,它说它们的字符串的日期时间标记格式为:
HH:MM:SS DD Mmm YY, YYYY PST
So year is specified twice?
那么一年指定两次?
Once in double digits, and another with 4 digits?
一次是两位数,另一位是4位数?
This looks bizarre.
这看起来很奇怪。
6 个解决方案
#1
This seems to be a bug in the documentation. The actual format should be "HH:MM:SS Mmm DD, YYYY PST" (e.g. "08:30:06 Apr 19, 2017 PDT")
这似乎是文档中的一个错误。实际格式应为“HH:MM:SS Mmm DD,YYYY PST”(例如“2017年4月19日08:30:06 PDT”)
#2
For php, the syntax is date("G:i:s M m, Y T");
对于php,语法是date(“G:i:s M m,Y T”);
#3
Actually in PHP you need to use date("Y-m-d\TH:i:s\Z") . That will result in something that looks like 2012-04-30T00:05:47Z -- I didn't notice a difference between urlencoded and non.
实际上在PHP中你需要使用日期(“Y-m-d \ TH:i:s \ Z”)。这将导致看起来像2012-04-30T00:05:47Z的东西 - 我没有注意到urlencoded和non之间的区别。
Where are you guys finding this info? This information is elusive in their documentation and cost me an hour or two of hunting and trying stuff. The only place I see this format is in the TIMESTAMP field. Having a hard time with the PayPal NVP API's PROFILESTARTDATE for CreateRecurringPaymentsProfile and a "Subscription start date should be valid" error.
你们在哪里找到这个信息?这些信息在他们的文档中是难以捉摸的,并且花了我一两个小时的狩猎和尝试的东西。我看到这种格式的唯一地方是在TIMESTAMP字段中。使用PayPal NVP API的PROFILESTARTDATE用于CreateRecurringPaymentsProfile并且“订阅开始日期应该是有效的”错误。
#4
this is the correct format according to their documentation - 2010-03-27T12:34:49Z so it is - YYYY-MM-DDTHH:MM:SSZ (I don't know what the T in the middle and Z is but it's constant for all the dates) I've created PayPal NVP library in Java, so if you want to check how it works, or use it, you are more than welcome. it's on sourceforge - payapal-nvp.sourceforge.net
根据他们的文档,这是正确的格式 - 2010-03-27T12:34:49Z所以它是 - YYYY-MM-DDTHH:MM:SSZ(我不知道中间的T和Z是什么,但它是恒定的对于所有的日期)我用Java创建了PayPal NVP库,所以如果你想检查它是如何工作的,或者使用它,你会非常受欢迎。它在sourceforge上 - payapal-nvp.sourceforge.net
#5
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 TZD = time zone designator (Z or +hh:mm or -hh:mm)
完成日期加上小时,分钟,秒和秒的小数部分YYYY-MM-DDThh:mm:ss.sTZD(例如1997-07-16T19:20:30.45 + 01:00)其中TZD =时区指示符(Z或+ hh:mm或-hh:mm)
Example 1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time.
例子1994-11-05T08:15:30-05:00对应于1994年11月5日,美国东部标准时间上午8:15:30。
1994-11-05T13:15:30Z corresponds to the same instant.
1994-11-05T13:15:30Z对应同一时刻。
#6
Actually, I think the right format is: yyyy-MM-ddTHH:MM:ssZ
实际上,我认为正确的格式是:yyyy-MM-ddTHH:MM:ssZ
The case is important.
这个案子很重要。
#1
This seems to be a bug in the documentation. The actual format should be "HH:MM:SS Mmm DD, YYYY PST" (e.g. "08:30:06 Apr 19, 2017 PDT")
这似乎是文档中的一个错误。实际格式应为“HH:MM:SS Mmm DD,YYYY PST”(例如“2017年4月19日08:30:06 PDT”)
#2
For php, the syntax is date("G:i:s M m, Y T");
对于php,语法是date(“G:i:s M m,Y T”);
#3
Actually in PHP you need to use date("Y-m-d\TH:i:s\Z") . That will result in something that looks like 2012-04-30T00:05:47Z -- I didn't notice a difference between urlencoded and non.
实际上在PHP中你需要使用日期(“Y-m-d \ TH:i:s \ Z”)。这将导致看起来像2012-04-30T00:05:47Z的东西 - 我没有注意到urlencoded和non之间的区别。
Where are you guys finding this info? This information is elusive in their documentation and cost me an hour or two of hunting and trying stuff. The only place I see this format is in the TIMESTAMP field. Having a hard time with the PayPal NVP API's PROFILESTARTDATE for CreateRecurringPaymentsProfile and a "Subscription start date should be valid" error.
你们在哪里找到这个信息?这些信息在他们的文档中是难以捉摸的,并且花了我一两个小时的狩猎和尝试的东西。我看到这种格式的唯一地方是在TIMESTAMP字段中。使用PayPal NVP API的PROFILESTARTDATE用于CreateRecurringPaymentsProfile并且“订阅开始日期应该是有效的”错误。
#4
this is the correct format according to their documentation - 2010-03-27T12:34:49Z so it is - YYYY-MM-DDTHH:MM:SSZ (I don't know what the T in the middle and Z is but it's constant for all the dates) I've created PayPal NVP library in Java, so if you want to check how it works, or use it, you are more than welcome. it's on sourceforge - payapal-nvp.sourceforge.net
根据他们的文档,这是正确的格式 - 2010-03-27T12:34:49Z所以它是 - YYYY-MM-DDTHH:MM:SSZ(我不知道中间的T和Z是什么,但它是恒定的对于所有的日期)我用Java创建了PayPal NVP库,所以如果你想检查它是如何工作的,或者使用它,你会非常受欢迎。它在sourceforge上 - payapal-nvp.sourceforge.net
#5
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 TZD = time zone designator (Z or +hh:mm or -hh:mm)
完成日期加上小时,分钟,秒和秒的小数部分YYYY-MM-DDThh:mm:ss.sTZD(例如1997-07-16T19:20:30.45 + 01:00)其中TZD =时区指示符(Z或+ hh:mm或-hh:mm)
Example 1994-11-05T08:15:30-05:00 corresponds to November 5, 1994, 8:15:30 am, US Eastern Standard Time.
例子1994-11-05T08:15:30-05:00对应于1994年11月5日,美国东部标准时间上午8:15:30。
1994-11-05T13:15:30Z corresponds to the same instant.
1994-11-05T13:15:30Z对应同一时刻。
#6
Actually, I think the right format is: yyyy-MM-ddTHH:MM:ssZ
实际上,我认为正确的格式是:yyyy-MM-ddTHH:MM:ssZ
The case is important.
这个案子很重要。