Is it possible to use DateTime.ParseExact to extract the dates? It looks like this method natively supports ISO 8601 date formats, and can also accept multiple format specifiers.
http://blog.stevex.net/parsing-dates-and-times-in-net/ Paul On Dec 24 2010, 9:12 am, CTIS C <[email protected]> wrote: > You got it right. But now we are not sure on how to handle this kind of > situation. > > > > > > > > On Tue, Dec 21, 2010 at 1:55 AM, Paul (Google) <[email protected]> wrote: > > Hi Ash, > > > Thanks for pointing this situation out. It's definitely something to > > look out for, and probably something that needs, at a minimum, better > > documentation. > > > The behaviour that I'm seeing is that if a date is left default in the > > UI, it comes out as Zulu time in the API (e.g. > > "2010-12-21T06:14:25.809Z"). If the date is changed in the UI, then > > it comes out as either "2010", "2010-12", or "2010-12-21", depending > > on the date precision entered in the UI. For me, this appears to be > > independent of whether it was the first of a subsequent entry for a > > measurement. Dates entered via the API with a time-zone offset (e.g. > > "2010-12-21T06:14:25-0500") seem to remain unchanged. I can't seem to > > be able to retrieve a date entered via the UI with a time-zone offset; > > they always come back in Zulu time or truncated if modified in UI. > > > Is this consistent with what you're seeing? If not, is there > > something that I'm missing? > > > The CCR ExactDateTime element uses the ISO 8601 standard, which is > > pretty broad. > > >http://en.wikipedia.org/wiki/ISO_8601 > > >http://www.iso.org/iso/support/faqs/faqs_widely_used_standards/widely... > > > If you want to accurately parse these dates/times, you may want to use > > a ISO 8601 compatible library. If you're programming in Java, the > > Joda Time library should be helpful. > > >http://joda-time.sourceforge.net/ > > > Thanks again! Please let me know if there's anything I'm missing! > > > Paul > > > On Dec 16, 8:22 am, CTISTeam <[email protected]> wrote: > > > Hi, Paul, > > > > In New version of Google Health allows user to enter date in three > > > formats. > > > > • Complete date (Includes Month, Date and Year) > > > • Month and Year > > > • Only Year > > > > Also these format help ('12/31/08', 'Dec 2008', or '2008' ) is > > > specified below any date entry fields in Google Health UI. And when we > > > pull CCR form Google using OAuth, dates comes in following formats. > > > ‘2008-12-31’,’ 2008-12’ and ‘2008’. > > > > These works fine, but the strange behavior has been observed in Test > > > Result and Wellness. In some case we are getting dates like > > > “2008-12-31T13:00:00-0500”. And this happens only when we enter an > > > episode for test result or wellness of any existing one. > > > > For any new entry of an existing episode of test result / wellness, > > > system will display today’s date by default. We have a option to > > > change a date… If we do not change date value then in CCR we get test > > > date with time and zone details (e.g. “2008-12-31T13:00:00-0500). And > > > we change date then we get only date part (e.g. 2008-12-31’). > > > > Please let know if I am not able to explain the problem properly. If > > > require I can send you further details. Also not sure this the way it > > > is or some issue… but not a consistent behavior I think . > > > > Thanks, > > > Ash > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Health Developers" group. > > To post to this group, send email to > > [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<googlehealthdevelopers% > > [email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/googlehealthdevelopers?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Health Developers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/googlehealthdevelopers?hl=en.
