473,414 Members | 1,628 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,414 software developers and data experts.

DateTime into equivalent long value

San
We are facing problem in converting the DateTime into equivalent long value in .NET, we need to pass this long value back to Java server. is this possible? if yes please send us some suggestion on the same.
Nov 22 '05 #1
2 1759
San <an*******@discussions.microsoft.com> wrote:
We are facing problem in converting the DateTime into equivalent long
value in .NET, we need to pass this long value back to Java server.
is this possible? if yes please send us some suggestion on the same.


Well, there's DateTime.Ticks - but that won't get you back the
equivalent java.util.Date if you pass it into the Date constructor.

To be honest, the best way of transferring a date in a portable fashion
is as a string in a well-defined format (such as ISO8601). If you don't
care about the timezone information being preserved, you may find it
easiest to convert to UTC first.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 22 '05 #2
San <an*******@discussions.microsoft.com> wrote:
We are facing problem in converting the DateTime into equivalent long
value in .NET, we need to pass this long value back to Java server.
is this possible? if yes please send us some suggestion on the same.


Well, there's DateTime.Ticks - but that won't get you back the
equivalent java.util.Date if you pass it into the Date constructor.

To be honest, the best way of transferring a date in a portable fashion
is as a string in a well-defined format (such as ISO8601). If you don't
care about the timezone information being preserved, you may find it
easiest to convert to UTC first.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 22 '05 #3

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

Similar topics

2
by: San | last post by:
We are facing problem in converting the DateTime into equivalent long value in .NET, we need to pass this long value back to Java server. is this possible? if yes please send us some suggestion on...
16
by: PK9 | last post by:
I have a string variable that holds the equivalent of a DateTime value. I pulled this datetime from the database and I want to strip off the time portion before displaying to the user. I am...
2
by: nic | last post by:
hey, I always struggle with the following: I have an object obj with a property paydate (type = DateTime) Now, after instantiating the object and do several things, I want too check if my...
2
by: - Steve - | last post by:
I'm taking the value of the expire date out of an AD account (accountExpires attribute) and passing it into this function. static DateTime LargeIntToDateTime(ActiveDs.LargeInteger li) { long...
3
by: Christopher Crooker | last post by:
We had a function with the signature: Function(Object *, DateTime, DateTime, EnumType) and then changed the class some and there was a 4 parameter function with the signature: ...
5
by: anony | last post by:
Hi, If I have a datetime, how do I display it as its13 digit numeric value? Thanks.
9
by: Phil B | last post by:
I am having a problem with a datetime from a web services provider The provider is sending the following SOAP response <?xml version="1.0" encoding="utf-8"?> <soap:Envelope...
1
by: A.Neves | last post by:
Hi, I'm having a problem, I have a DateTime value in Portuguese representation (dd-mm-yyyy) and I'm using SQLServer2005 with its default language English (yyyy-mm-dd), so when I assemble a WHERE...
14
by: msavazzi | last post by:
Hi, it should be simple, put FILETIME in a Long conver it in date using the DateTime.FromFileTimeUtc The help even says: Converts the specified Windows file time to an equivalent UTC time. ...
4
by: sumip | last post by:
I just made a pretty strange observation with .NET 2.0 - DateTime.AddMilliseconds(double) and AddSeconds(double) seem to be broken: DateTime now = new DateTime(); DateTime t2 =...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.