Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. ISO 8601 Date/Time Format

ISO 8601 Date/Time Format

Scheduled Pinned Locked Moved C#
visual-studiohelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    LiamD
    wrote on last edited by
    #1

    I know that you can get ISO 8601 date/time format using DateTimeFormatInfo.SortableDateTimePattern. From the VS help on DateTimeFormatInfo.SortableDateTimePattern we can get:- "This code produces the following output. CULTURE PROPERTY VALUE en-US yyyy'-'MM'-'dd'T'HH':'mm':'ss ja-JP yyyy'-'MM'-'dd'T'HH':'mm':'ss fr-FR yyyy'-'MM'-'dd'T'HH':'mm':'ss" However, there does not seem to be any mention of the timezone extension. i.e. in the format YYYY-MM-DDThh:mm:ss±hh:mm How can I add the ±hh:mm based on the current timezone location. Thanks, Liam

    G 1 Reply Last reply
    0
    • L LiamD

      I know that you can get ISO 8601 date/time format using DateTimeFormatInfo.SortableDateTimePattern. From the VS help on DateTimeFormatInfo.SortableDateTimePattern we can get:- "This code produces the following output. CULTURE PROPERTY VALUE en-US yyyy'-'MM'-'dd'T'HH':'mm':'ss ja-JP yyyy'-'MM'-'dd'T'HH':'mm':'ss fr-FR yyyy'-'MM'-'dd'T'HH':'mm':'ss" However, there does not seem to be any mention of the timezone extension. i.e. in the format YYYY-MM-DDThh:mm:ss±hh:mm How can I add the ±hh:mm based on the current timezone location. Thanks, Liam

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Just add zzz to the format string. --- b { font-weight: normal; }

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups