Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6195859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:32:32+00:00 2026-05-24T03:32:32+00:00

I am parsing an XML file that has a field called UTCTime and contains

  • 0

I am parsing an XML file that has a field called UTCTime and contains the value 1311346453064. It also comes with a field called UTC that contains the value 2011-07-22T10:54:13.064-04:00 which is a complete .Net DateTimeOffset I believe. The first field I can’t figure out though. What generates a date in that way? It’s too large to be a unix timestamp since it adds about 41 millenia to 1/1/1970. Any help in identifying it or how I can convert it to a datetime without using that second field would be a great help! Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T03:32:35+00:00Added an answer on May 24, 2026 at 3:32 am

    It is equivalent to the unix timestamp [i.e. a straight count since 1970] but in milliseconds instead of seconds.

    $ date -d @1311346453
    Fri Jul 22 10:54:13 EDT 2011
    

    Ending with 3064 made it obvious to me.

    So, to convert in .NET you would use

    static readonly DateTime epoch = new DateTime(1970,1,1,0,0,0,
                                                  DateTimeKind.Utc);
    long value = 1311346453064L;
    var ts = new TimeSpan(value*TimeSpan.TicksPerMillisecond);
    var dt = epoch + ts;
    

    Or, slightly more efficiently at a cost of some readability

    const long epochTicks = 621355968000000000L;
    var dt = new TimeSpan(value*TimeSpan.TicksPerMillisecond+epochTicks,
                          DateTimeKind.Utc);
    

    Note that this discards the timezone information (the offset of -04:00) in the other field.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've parsing a xml file that sometimes has the value <avg_cpc>some number</avg_cpc> sometime don't.
I am parsing an xml file (called xml below) that has lines of two
I'm parsing an xml file, that has nodes with text like this: <img src=someUrl1>
I am parsing an xml file with jquery and ajax. I noticed that it
I'm writing a program that's parsing an XML file to java objects using smooks.
I am parsing and html/xml file. I am bit confused with the fact that
Currently I'm working on an application that has to parse a large XML file
I was parsing an XML that has an image that is Base64 encoded. I
I'm parsing an XML file and filling a table view. The XML has a
I'm reading data from a XML file which has a UTC date looking like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.