locked
global time&date RRS feed

  • Question

  • iam working on win8 store app and i need to get the current time "not my local machine time " but the global time thanks in advanced.. 
    Thursday, May 2, 2013 7:56 PM

Answers

  • By global time vs. local machine time do you mean UTC? Or (as Sachin suggests) are you concerned that the machine's time won't be set correctly?

    For UTC see DateTime.UtcNow

    --Rob

    • Proposed as answer by Jernej Kavka Friday, May 3, 2013 5:37 AM
    • Marked as answer by Aaron Xue Thursday, May 9, 2013 8:02 AM
    Thursday, May 2, 2013 8:28 PM
    Moderator

All replies

  • You can use Network Time Protocol (NTP) to get current time. Here is C# code which you may need to convert for windows store app.

    http://dotnet-snippets.com/dns/simple-network-time-ntp-protocol-client-SID571.aspx


    Thanks,
    Sachin
    My Samples | Personal Website

    Thursday, May 2, 2013 8:15 PM
  • By global time vs. local machine time do you mean UTC? Or (as Sachin suggests) are you concerned that the machine's time won't be set correctly?

    For UTC see DateTime.UtcNow

    --Rob

    • Proposed as answer by Jernej Kavka Friday, May 3, 2013 5:37 AM
    • Marked as answer by Aaron Xue Thursday, May 9, 2013 8:02 AM
    Thursday, May 2, 2013 8:28 PM
    Moderator
  • iam working on win8 store app and i need to get the real universal time not my universal local time thanks in advanced  ...
    Wednesday, May 8, 2013 7:34 PM