PC Review


Reply
Thread Tools Rate Thread

How to convert a J2EE date as a long ("Millis") in a .NET date as a long ("Ticks")?

 
 
Num
Guest
Posts: n/a
 
      13th Feb 2004
Hi all,

I have to convert a J2EE date as a long ("Millis") in a .NET date as a
long ("Ticks")

In Java, currentTimeMillis, is the difference, measured in
milliseconds, between the current time and midnight, January 1, 1970
UTC.

In .NET, DateTime.Ticks is the 100-nanosecond intervals that have
elapsed since 12:00 A.M., January 1, 0001 (!!!)

So, I think that the formula is:
------------------------------------------------------------------
| T = t * 10E4 + 621 355 968 000 000 000 |
| "Ticks .NET" "Millis Java" |
------------------------------------------------------------------

Correct or not?

Cheers,

Num
 
Reply With Quote
 
 
 
 
Anthony Moore
Guest
Posts: n/a
 
      18th Feb 2004
This was covered on another forum also.

This conversion code is valid.
--------------------
| From: (E-Mail Removed) (Num)
| Newsgroups: microsoft.public.dotnet.general
| Subject: How to convert a J2EE date as a long ("Millis") in a .NET date
as a long ("Ticks")?
| Date: 13 Feb 2004 07:05:02 -0800
| Organization: http://groups.google.com
| Lines: 23
| Message-ID: <(E-Mail Removed)>
| NNTP-Posting-Host: 195.68.44.199
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1076684702 10167 127.0.0.1 (13 Feb 2004
15:05:02 GMT)
| X-Complaints-To: groups-(E-Mail Removed)
| NNTP-Posting-Date: Fri, 13 Feb 2004 15:05:02 +0000 (UTC)
| Path:
cpmsftngxa07.phx.gbl!cpmsftngxa10.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP08
.phx.gbl!newsfeed00.sul.t-online.de!t-online.de!newsfeed.icl.net!newsfeed.fj
serv.net!news.maxwell.syr.edu!postnews1.google.com!not-for-mail
| Xref: cpmsftngxa07.phx.gbl microsoft.public.dotnet.general:124588
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Hi all,
|
| I have to convert a J2EE date as a long ("Millis") in a .NET date as a
| long ("Ticks")
|
| In Java, currentTimeMillis, is the difference, measured in
| milliseconds, between the current time and midnight, January 1, 1970
| UTC.
|
| In .NET, DateTime.Ticks is the 100-nanosecond intervals that have
| elapsed since 12:00 A.M., January 1, 0001 (!!!)
|
| So, I think that the formula is:
| ------------------------------------------------------------------
| | T = t * 10E4 + 621 355 968 000 000 000 |
| | "Ticks .NET" "Millis Java" |
| ------------------------------------------------------------------
|
| Correct or not?
|
| Cheers,
|
| Num
|

 
Reply With Quote
 
Num
Guest
Posts: n/a
 
      18th Feb 2004
(E-Mail Removed) (Anthony Moore) wrote in message news:<(E-Mail Removed)>...
> This was covered on another forum also.
>
> This conversion code is valid.


Ok, That's all I wanted to know

Thanks a lot

Num
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel VBA to convert "dd.MM.yy" text to "dd/MM/yyyy" format date? =?Utf-8?B?UGF1bCBK?= Microsoft Excel Programming 4 11th Jul 2007 11:32 AM
Change column of DateTime type to "long date" format Curious Microsoft Dot NET 4 27th May 2007 03:18 PM
Display DateTime column in "long date" format Curious Microsoft Dot NET 0 25th May 2007 06:33 PM
Convert a column from "Short Date" to "Long Date" Curious Microsoft Dot NET 0 25th May 2007 03:23 PM
Obtain .NET "Ticks" from J2EE "Millis" Num Microsoft Dot NET 2 18th Feb 2004 10:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:44 PM.