Questions tagged [rfc3339]

A RFC entitled "Date and Time on the Internet: Timestamps"

See for more details on RFC

RFC 3339 was released in July 2002.

RFC 3339 is a simplification of which excludes durations, week numbers and ordinal days.

Resources:

100 questions
18
votes
2 answers

Unmarshal incorrectly formatted datetime

Background I am learning Go and I'm trying to do some JSON unmarshaling of a datetime. I have some JSON produced by a program I wrote in C, I am outputting what I thought was a valid ISO8601 / RFC3339 timezone offset. I'm using strftime with the…
Joakim
  • 11,468
  • 9
  • 44
  • 50
17
votes
3 answers

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

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…
rgeorge
  • 7,385
  • 2
  • 31
  • 41
17
votes
1 answer

What pattern should be used to parse RFC 3339 datetime strings in java

This seems to be a common question with many different answers. Before you answer, I have used both joda-time and atomdate and they work great. My interest here is not what library to use but instead a clarification on how RFC pattern should be…
alexgophermix
  • 4,189
  • 5
  • 32
  • 59
11
votes
2 answers

RFC 3339 how make a dateTime from

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…
JahStation
  • 893
  • 3
  • 15
  • 35
9
votes
2 answers

C# DateTime - RFC 3339 format

I am trying to generate RFC 3339 compliant date strings (ie. '2008-03-19T00:00:00.0000000-04:00') however I seem to be having an issue with the offset being invalid. I am using the following: private string GetDate(DateTime DateTime) { DateTime…
cweston
  • 11,297
  • 19
  • 82
  • 107
8
votes
7 answers

RFC822 Timezone Parsing in Java

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…
Jamen
  • 81
  • 1
  • 1
  • 2
6
votes
1 answer

C++ RFC3339 timestamp with milliseconds using std::chrono

I'm creating an RFC3339 timestamp, including milliseconds and in UTC, in C++ using std::chrono like so: #include #include #include using namespace std; using namespace std::chrono; string now_rfc3339() { const auto now…
sebastian
  • 2,386
  • 26
  • 22
6
votes
2 answers

Parse RFC3339/ISO 8601 timestamp in Boost

How do I parse a RFC3339 timestamp ("1985-04-12T23:20:50.52Z") (i.e. a subset of ISO8601) in C++03? I'm using Boost, but none of the Boost datetime libraries seem to include a function to do this. The type of the actual time object doesn't matter,…
Phil
  • 2,239
  • 3
  • 25
  • 26
6
votes
3 answers

Convert timestamp to rfc 3339 in Python

I am trying to convert the timestamp 1452454659 to its rfc3339 equivalent. I am getting the output as: 2016-01-11T01:07:39+05:30 When I pass this to influxdb it returns a time of: 2016-01-10T19:37:39Z while I actually want the time in influxdb to…
Vishal Puliani
  • 201
  • 1
  • 3
  • 14
5
votes
2 answers

RFC3339 time parsing in golang

I'm pulling a timestamp from a datebase, it is using RFC3339 format but the timezone is missing. So when I try to compare the timestamps it will be off. How do I change dbtime to be Eastern time? // time format const ( RFC3339 =…
Shawn Rose
  • 51
  • 1
  • 1
  • 2
5
votes
2 answers

Output Go time in RFC3339 like MySQL format

In Holland we mostly use YYYY-MM-DD HH:MM:SS. How can I format that in Go? Everything I insert (even according the standard) gives weird numbers. This is my code (p.Created is a NanoSeconds int64 object): package main import ( "database/sql" …
user1467267
4
votes
3 answers

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

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…
eonil
  • 83,476
  • 81
  • 317
  • 516
4
votes
2 answers

(De)serialize RFC-3339 timestamp with serde to time-rs OffsetDateTime

My goal is to (de)serialize objects with RFC-3339 timestamps from Json to Rust structs (and vice versa) using serde and time-rs. I would expect this ... use serde::Deserialize; use time::{OffsetDateTime}; #[derive(Deserialize)] pub struct DtoTest…
Mthenn
  • 189
  • 1
  • 14
4
votes
1 answer

Howto format a boost::date_time-object as per RFC 3339

I want to use the date_time library in boost to represent time in my application. This application will generate Atom feeds, which in turn mandates time-stamps in the format specified in RFC 3339, for example "1990-12-31T23:59:60Z" or…
Magnus Hoff
  • 21,529
  • 9
  • 63
  • 82
4
votes
1 answer

Keep original time zone with NSDateFormatter

I have strings like 2011-01-19T20:30:00-5:00 and I'd like to parse them into an NSDate but I want to keep the original time zone. NSDateFormatter *dateFormatter = [NSDateFormatter new]; [dateFormatter setDateFormat:…
Malawy
  • 41
  • 3