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

  • SEARCH
  • Home
  • 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 8890619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:32:36+00:00 2026-06-14T22:32:36+00:00

I have an input timestamp from C# ( .NET epoch: 00:00:00 (midnight), January 1,

  • 0

I have an input timestamp from C# (.NET epoch: 00:00:00 (midnight), January 1, 0001) and I want to output it in Ruby world (Unix epoch: 00:00:00 UTC on 1 January 1970).

The input timestamp is given in UTC, and derived from .NET’s DateTime(Int64), which is “a date and time expressed in the number of 100-nanosecond intervals that have elapsed since January 1, 0001 at 00:00:00.000 in the Gregorian calendar.“

The input timestamp: 634891434586852680

Output should be 2012-NOV-21 a bit after 5pm PST.

  • 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-06-14T22:32:38+00:00Added an answer on June 14, 2026 at 10:32 pm
    input =                         634891434586852680
    UNIX_EPOCH_IN_100NS_INTERVALS = 621355968000000000
    
    Time.at((input-UNIX_EPOCH_IN_100NS_INTERVALS)*1e-7).utc.getlocal
     => 2012-11-21 17:10:58 -0800
    

    In Ruby, Time is stored internally as the number of seconds with fraction since the Epoch, January 1, 1970 00:00 UTC. Therefore we must convert from 100-nanosecond intervals to seconds.

    The conversion factor of 1e-7 is 1e2/1e9 which is 100/1000000000 which can be explained as:

    X intervals * 100ns/interval * 1s/1000000000ns
    

    The intervals cancel themselves out, as do the nanoseconds, and we are left with seconds; and 100/1000000000 seconds is 1e2/1e9 seconds which is 1e-7 seconds.

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

Sidebar

Related Questions

I have an input file that I want to sort based on timestamp which
I have input.txt and I want to search for a string and extract a
i have input xml as <content> <date> <day>14</day> <month>06</month> <year>2012</year> </date> </content> want it
Currently I have Input: e.g., '123456789'.'+'.'987654321' Desired Pattern: Output: e.g., '123456789987654321' How can I
I am working on templating system. I do have input of html document from
I have a project that Asks for input from the user (@startdate and @enddate)
Say I have two log files ( input.log and output.log ) with the following
I have a range slider and I want it to display values from a
I have seconds input ordered data from smallest to largest for both times. start_time[s]
I have input text: <div><label wicket:for=name>Name</label><input type=text wicket:id=name /></div> Now I need to add

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.