473,769 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Convert today's date and time to a long

Hi I have to convert am today's date and time (now) to a webservice.
The example the web service gives was "1163313527144# " which comes out
to 12/31/1969 06:00 PM. How do I convert a date to a 13 digit long
value?

Nov 29 '06 #1
4 7390

Holmsey wrote:
Hi I have to convert am today's date and time (now) to a webservice.
The example the web service gives was "1163313527144# " which comes out
to 12/31/1969 06:00 PM. How do I convert a date to a 13 digit long
value?
what format is that? There are lots of ways to represent a date as a
long value...

--
Tom Shelton

Nov 29 '06 #2

Tom Shelton wrote:
Holmsey wrote:
Hi I have to convert am today's date and time (now) to a webservice.
The example the web service gives was "1163313527144# " which comes out
to 12/31/1969 06:00 PM. How do I convert a date to a 13 digit long
value?

what format is that? There are lots of ways to represent a date as a
long value...

--
Tom Shelton
Im am trying to figure out todays date as a long value from (A
millisecond value that is an offset from the Epoch, January 1, 1970
00:00:00.000 GMT (Gregorian).)

Nov 29 '06 #3

Tom Shelton wrote:
Holmsey wrote:
Hi I have to convert am today's date and time (now) to a webservice.
The example the web service gives was "1163313527144# " which comes out
to 12/31/1969 06:00 PM. How do I convert a date to a 13 digit long
value?

what format is that? There are lots of ways to represent a date as a
long value...

--
Tom Shelton
Im am trying to figure out todays date as a long value from (A
millisecond value that is an offset from the Epoch, January 1, 1970
00:00:00.000 GMT (Gregorian).)

Nov 29 '06 #4

Holmsey wrote:
Tom Shelton wrote:
Holmsey wrote:
Hi I have to convert am today's date and time (now) to a webservice.
The example the web service gives was "1163313527144# " which comes out
to 12/31/1969 06:00 PM. How do I convert a date to a 13 digit long
value?
what format is that? There are lots of ways to represent a date as a
long value...

--
Tom Shelton

Im am trying to figure out todays date as a long value from (A
millisecond value that is an offset from the Epoch, January 1, 1970
00:00:00.000 GMT (Gregorian).)
Ok... How 'bout:

Dim epoch As New DateTime (1970, 1, 1, 0, 0, 0, 0)
Dim diff As TimeSpan = DateTime.Now.Su btract (epoch)
Dim ms As Long = CType (diff.TotalMill iseconds, Long)
Console.WriteLi ne (ms)

Nov 29 '06 #5

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

Similar topics

19
7287
by: Lauren Quantrell | last post by:
I have a stored procedure using Convert where the exact same Convert string works in the SELECT portion of the procedure but fails in the WHERE portion. The entire SP is listed below. Specifically, I have a problem with this portion in the WHERE clause: DATEADD(Day,tblMyEventTableName.ReminderDays, @DateNow) Between CONVERT(smalldatetime,str(DATEPART(Month, @DateNow)+1) + '/' + str(DATEPART(Day, tblMyEventTableName.TaskDateTime)) + '/'...
1
3629
by: Num | last post by:
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
5
1726
by: Ivan Marsh | last post by:
Hey Folks, This code works in IE but not in Mozilla. I'd like it to work in both. I'm sure it has something to do with the way I'm passing the anchor object but I can't figure it out. <SCRIPT TYPE='text/JavaScript'> function GetTime(TimeAnchor) { today = new Date();
2
8917
by: davidgordon | last post by:
Hi, I have some pages with this VBScript code, which obviously does not work in Firefox. How can I convert this to Javascript in order for my web page to work in Firefox ? It basically fills a drop down with a list of dates that a user can select. Appreciate any help you can offer ----------------------
1
4757
by: Islam Elkhayat | last post by:
In my C# Webapplication.. I enter the date in a textbox using popup Calender in the format MM/dd/yyyy.. when i retrieve date from Sql server for updating using datarow to fill the textbox the date format dd/MM/yyyy hh-mm-ss i want to convert it back to the original format & ommit the time.. How can i convert this back so i void the exception if user didn't change date in the update form?? Any help plz
1
4902
by: Raja | last post by:
Hi Anyone has any idea of how to convert Julian Date (eg. 12744057862..) to a VB.NET date time. Thanks in advance.
2
9578
by: yxq | last post by:
There are 8 bytes binary value stored date and time in Registry. 84 8B D7 DF 8B 28 C5 01 I want to convert the binary value to date using VB.NET. Dim a As FILETIME a.dwHighDateTime = 29698187 '(01C5288B to decimal) a.dwLowDateTime = -539522172 '(??????? by 84 8B D7 DF) MsgBox (GetFileToSystemDate(a, False))
9
25104
by: romy | last post by:
It used to work in vb6. I don't know the syntax in vb.net current date and time.... format (cstr(date),"DDMMYY") format(cstr(time),"HHMM") thanks
17
71457
by: Terry Jolly | last post by:
New to C# ---- How do I convert a Date to int? In VB6: Dim lDate as long lDate = CLng(Date) In C#
0
9589
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10215
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9996
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8872
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7410
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5307
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3964
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.