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 7566179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:20:47+00:00 2026-05-30T14:20:47+00:00

I am porting a Python script to C#. Currently I have encountered the code

  • 0

I am porting a Python script to C#.

Currently I have encountered the code that uses

time.time()

As per Python documentation this function call returns a float of total count of seconds.

Return the time as a floating point number expressed in seconds since
the epoch, in UTC. Note that even though the time is always returned
as a floating point number, not all systems provide time with a better
precision than 1 second. While this function normally returns
non-decreasing values, it can return a lower value than a previous
call if the system clock has been set back between the two calls.

How can I get the same from CLR?

  • 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-30T14:20:49+00:00Added an answer on May 30, 2026 at 2:20 pm

    The start of “the Epoch” on Unix refers to January 1, 1970. That’s a fairly arbitrary date, set to be “early enough” that anyone querying the time since that date would get a positive number of seconds.

     TimeSpan t = (DateTime.UtcNow - 
                   new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc));
     float seconds  = (float) t.TotalSeconds;
     Console.WriteLine (seconds);
    

    http://blogs.msdn.com/b/brada/archive/2004/03/20/93332.aspx

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

Sidebar

Related Questions

I'm porting some code from Python 2 to 3. This is valid code in
I'm currently porting my GAE app to Python 2.7 and have come across some
I'm porting a Bash script to Python. The script sets LC_ALL=C and uses the
I'm porting a bash script to python 2.6, and want to replace some code:
I've got a JSON string that I'm posting to my Python script. This is
I have a small project I want to try porting to Python 3 -
I don't know python and I'm porting a library to C#, I've encountered the
So here we have a Python script: Record a few seconds of audio and
While porting over a code fragment from python I've stumbled over a trivial problem:
I am porting visual c++ 6 application to python using ctypes. It uses same

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.