473,394 Members | 1,843 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Unix epoch in C#

Hi,

Can someone please tell me how I can set DateTime to 01/01/1970 (UTC).
Doing the following

DateTime dt1 = new DateTime(1970, 1,1);
Debug.WriteLine("dt1(utc):"+ dt1.ToUniversalTime().ToString());

Doing the following returns 1/1/1970 5:00:00 AM

However, I want to set the DateTime so that it would return 1/1/1970
12:00:00 AM instead.

Basically force DateTime(1970,1,1) to be UTC.

Thanks
Maz.
Dec 2 '05 #1
0 1077

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Oxnard | last post by:
I have the number of micro seconds from the UNIX epoch time 00:00:00 UTC 1 Jan 1970. (1092727073895638 usec) I want to know the time in CST. I have been trying to work with the Calendar class...
3
by: Mitchell Vincent | last post by:
Would anyone happen to have any idea how to get a UNIX timestamp (AKA epoch, or number of seconds since Jan 1st 1970) into a VB.NET datetime type? I have a legacy application I'm trying to port and...
2
by: In. Martin Prášek | last post by:
I I read the documentation well (PG 7.3.3 ) , i see that there is not a native support for data type UNIX TIMESTAMP and "unix timestamp expressed as microseconds" ie there it is impossible...
2
by: John Reese | last post by:
Hi. >>> import time, calendar, datetime >>> n= 1133893540.874922 >>> datetime.datetime.fromtimestamp(n) datetime.datetime(2005, 12, 6, 10, 25, 40, 874922) >>> lt= _ >>>...
2
by: Luis P. Mendes | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I've inserted a couple hundred rows in a table in Postgres via psycopg2. The first field of each row is a certain unix time (since epoch)...
6
by: marc | last post by:
hi im trying to convert Date() into a unix timestamp so i can stick the result into a mysql db, please help!
37
by: David T. Ashley | last post by:
I have Red Hat Enterprise Linux 4. I was just reading up about UTC and leap seconds. Is it true on my system that the Unix time may skip up or down by one second at midnight when there is a...
5
by: Grey Alien | last post by:
I need to convert timestamps that are given as the number of seconds that have elapsed since midnight UTC of January 1, 1970, (not counting leap seconds). It seems all of the std C functions...
11
by: usenet | last post by:
Is the epoch time the number of seconds elapsed since January 1st 1970 in my timezone or as per UTC? I mean, if A's program makes a call to time() in Melboune and B's program makes a call to...
1
!NoItAll
by: !NoItAll | last post by:
Hi: I have to convert a data (not the current date) to GMT and represent it as a Unix Epoch. This is what I'm trying - it returns something that looks correct - but I'd like to know if anyone...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.