相关文章推荐
挂过科的雪糕  ·  PyQt5 ...·  1 年前    · 
稳重的保温杯  ·  linux ...·  1 年前    · 
坏坏的帽子  ·  qt ...·  1 年前    · 
开朗的豆芽  ·  Ngen.exe (Native ...·  1 年前    · 
深情的毛豆  ·  Configuring Maximo ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I have rather lengthy URL that I am using in an application to receive XML data. I'd like to manipulate the time in the URL based on the users time but I don't know how to interpret it.

Here's the date and time from the URL:

2015-04-27T00%3A00%3A00

My Question:

Is there a way to manipulate this to show the current time? For example if I wanted to say that it was 2015-04-27 at 5:30pm CST.

2015-04-27T00%3A00%3A00 apparently is the URL encoded (conforming to RFC 3986) form of

2015-04-27T00:00:00 (%3A encodes the colon :).

This, in turn, is the standard ISO 8601 representation for 12:00 AM on April, 27th 2015 UTC.

"2015-04-27 at 5:30pm CST" could hence be represented as

2015-04-27T17:30:00-06:00 in ISO, or

2015-04-27T17%3A30%3A00-06%3A00 in URL encoded format.

great answer, you've answered a few underlying questions I had as well. Thanks again hanno – Dan Beaulieu Apr 27, 2015 at 14:49 The time part (after T) being 00:00:00 may indicate though that the server sides operates on dates only and does not value any more precise representation. If there's no documentation, you'd have to try to find out. Just don't be surprised if it does not work right. – JimmyB Apr 27, 2015 at 14:57 I just tried it out, it's returning data but i haven't looked closely at the XML yet to see if it's starting at midnight or at my specified time. – Dan Beaulieu Apr 27, 2015 at 14:59

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.