rfc3339

jQuery UI DatePicker date convert to RFC 3339 format

我是研究僧i 提交于 2019-12-12 02:31:30
问题 Currently working on the Google Calendar API and basically my end will provide Start and End date for user to pick the date and time. But would like anyone to advise how to convert them from (DatePicker/TimePicker/input field) to RFC 3339 format (e.g. 2013-07-24T10:00:00.000-07:00). 回答1: var date = new Date(); var timeZone = date.getTimezoneOffset(); alert(date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate() + "T" + date.getHours() + ":" + date.getMinutes() + ":" + date

I'm trying to build an RFC3339 timestamp in C. How do I get the timezone offset?

回眸只為那壹抹淺笑 提交于 2019-12-11 09:07:09
问题 I'm attempting to put together an RFC3339 timestamp which will be used to write a certain entry to a database. That would be formatted as, for example, 2004-10-19 10:23:54+02, where the +02 is the offset in hours from GMT. It's this offset which is proving troublesome - I can't seem to derive this value in C. Here is the code I'm using. When I try to build, it says the tm struct doesn't have a member named tm_gmtoff: #include <time.h> #include <stdio.h> int main(void) { time_t now = time(NULL

Zend Google Calendar API - How to Change DateTime Format?

☆樱花仙子☆ 提交于 2019-12-11 05:39:16
问题 I am using the Zend Framework Gdata for the Google Calendar API and the datetime outputs in RFC3339 (which looks like this: 2012-01-19T22:00:00.000-08:00). What php code do I need to add in order to convert that to UTC so that it looks like this: January 19, 2012 8pm-11pm ? I have found php code that converts RFC dates to string, but I don't know enough about php to be able to alter the code to work with the Zend Gdata formulas... as you will see in my code below, the "date" is referred to as

What's the simplest way to parse RFC3339 date string in iOS?

两盒软妹~` 提交于 2019-12-10 09:36:53
问题 Youtube API returns date string in RFC3339 format. I found how to parse it on manual, anyway, this is too long. - (NSString *)userVisibleDateTimeStringForRFC3339DateTimeString:(NSString *)rfc3339DateTimeString // Returns a user-visible date time string that corresponds to the // specified RFC 3339 date time string. Note that this does not handle // all possible RFC 3339 date time strings, just one of the most common // styles. { NSString * userVisibleDateTimeString; NSDateFormatter *

Convert UTC time to python datetime

ぐ巨炮叔叔 提交于 2019-12-08 01:50:33
问题 I have numerous UTC time stamps in the following format: 2012-04-30T23:08:56+00:00 I want to convert them to python datetime objects but am having trouble. My code: for time in data: pythondata[i]=datetime.strptime(time,"%y-%m-%dT%H:%M:%S+00:00") I get the following error: ValueError: time data '2012-03-01T00:05:55+00:00' does not match format '%y-%m-%dT%H:%M:%S+00:00' It looks like I have the proper format, so why doesn't this work? 回答1: Change the year marker in your time format string to

Convert UTC time to python datetime

流过昼夜 提交于 2019-12-06 04:44:55
I have numerous UTC time stamps in the following format: 2012-04-30T23:08:56+00:00 I want to convert them to python datetime objects but am having trouble. My code: for time in data: pythondata[i]=datetime.strptime(time,"%y-%m-%dT%H:%M:%S+00:00") I get the following error: ValueError: time data '2012-03-01T00:05:55+00:00' does not match format '%y-%m-%dT%H:%M:%S+00:00' It looks like I have the proper format, so why doesn't this work? Jon Gauthier Change the year marker in your time format string to %Y : time = '2012-03-01T00:05:55+00:00' datetime.strptime(time, "%Y-%m-%dT%H:%M:%S+00:00") # =>

What's the simplest way to parse RFC3339 date string in iOS?

梦想与她 提交于 2019-12-05 12:18:30
Youtube API returns date string in RFC3339 format. I found how to parse it on manual, anyway, this is too long. - (NSString *)userVisibleDateTimeStringForRFC3339DateTimeString:(NSString *)rfc3339DateTimeString // Returns a user-visible date time string that corresponds to the // specified RFC 3339 date time string. Note that this does not handle // all possible RFC 3339 date time strings, just one of the most common // styles. { NSString * userVisibleDateTimeString; NSDateFormatter * rfc3339DateFormatter; NSLocale * enUSPOSIXLocale; NSDate * date; NSDateFormatter * userVisibleDateFormatter;

RFC822 Timezone Parsing in Java

时光怂恿深爱的人放手 提交于 2019-12-05 03:05:35
I have a JS date that is being converted by Dojo into RFC822 format. The function call - dojo.date.toRfc3339(jsDate), generates the following date - 2007-02-26T20:15:00+02:00. I have an application that uses a Java date SimpleDateFormat to parse in the dates generated above. I am having problems parsing this date format due to the timezone. I have attempted to use yyyy-mm-DD'T'hh:mm:ssZ This fails as the 'Z' for timezone doesn't expect a ':' character. Does anyone know how I would specify a pattern to handle a RFC822 date with the ':'? revision: Thanks for correctly interpreting what I am

Parsing rfc3339 dates with NSDateFormatter in iOS 4.x and MacOS X 10.6: impossible?

烂漫一生 提交于 2019-12-03 02:55:27
Parsing a rfc3339 date with NSDateFormatter appears to be impossible, in the general case. Am I wrong? [Edit 2 years later: there is now a way! See below and footnote.] A not-especially-malleable web service is feeding me dates like: 2009-12-31T00:00:00-06:00 Rfc3339 compliant, default output of the jaxb library they're using. Note the colon, which rfc3339 requires when the offset isn't a literal "z": time-numoffset = ("+" / "-") time-hour ":" time-minute time-offset = "Z" / time-numoffset I want to parse these into NSDates. NSDateFormatter wants patterns in the syntax specified by Unicode ,

RFC 3339 how make a dateTime from

一笑奈何 提交于 2019-12-01 16:04:38
I'm trying to format a date passed from a google plus Api thats like the guide says in RFC 3339 format: PUBLISHED-> datetime-> The time at which this activity was initially published. Formatted as an RFC 3339 timestamp. So by php documentation i found that: DATE_RFC3339 Same as DATE_ATOM (since PHP 5.1.3) And that both format are something like: "Y-m-d\TH:i:sP" Actually the output of the Google api is something like: 2014-01-22T10:36:00.222Z When I'm trying to launch command like: $date = DateTime::createFromFormat("Y-m-d\TH:i:sP", $activity['published']); //$activity['published'] contain the