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

Date Time Difference...

Hello all,

I was wondering if someone could help me here. Since I'm running and
iMac, I don't have Visual Basic (6) installed. I want a small function
returns the number of seconds between two dates.

Can anyone help me with this? I would appreciate it.

Thanks,

Steve

Dec 28 '07 #1
3 7069
On Fri, 28 Dec 2007 01:54:02 GMT, Steve wrote:
I was wondering if someone could help me here. Since I'm running
and iMac, I don't have Visual Basic (6) installed. I want a small
function returns the number of seconds between two dates.

Can anyone help me with this? I would appreciate it.
Dim result As Long, day1 As Date, day2 As Date
day1 = Now
day2 = Now - 1
result = DateDiff("s", day1, day2)

' If you always want a positive number, then:
result = Abs(DateDiff("s", day1, day2))

--
Talking to you is like talking to an omelet at times.

--
Posted via a free Usenet account from http://www.teranews.com

Dec 28 '07 #2
On Thu, 27 Dec 2007 20:54:02 -0500, Steve <st**************@aol.com>
wrote:
>Hello all,

I was wondering if someone could help me here. Since I'm running and
iMac, I don't have Visual Basic (6) installed. I want a small function
returns the number of seconds between two dates.

Can anyone help me with this? I would appreciate it.

Thanks,

Steve
Are you wanting the VB function or just the number of seconds? If the
latter, set up a simple spreadsheet and you'll even be able to format
the result the way you want.
Jan 1 '08 #3
On Tue, 01 Jan 2008 11:49:22 GMT, wrote:
On Thu, 27 Dec 2007 20:54:02 -0500, Steve
<st**************@aol.comwrote:
>>I was wondering if someone could help me here. Since I'm running
and iMac, I don't have Visual Basic (6) installed. I want a small
function returns the number of seconds between two dates.

Can anyone help me with this? I would appreciate it.

Are you wanting the VB function or just the number of seconds? If
the latter, set up a simple spreadsheet and you'll even be able to
format the result the way you want.
Since this is a VB group, and not a spreadsheet/excel/office/whatever
group, I think it's safe to assume that the OP wanted to do this
programmatically.

--
Stupid asshole.

--
Posted via a free Usenet account from http://www.teranews.com

Jan 2 '08 #4

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

Similar topics

5
by: akoper | last post by:
I have a table that is a project. Each record is a task in the project. One field in each record is a date/time stamp for when that task was completed. I need to be able to: 1) compute how much...
28
by: Steve | last post by:
Hi all How would I find out the average date when given a bunch of dates? For example, I want to find the average length in time from the following dates:...
4
by: qtip | last post by:
I have a simple table the has First Name , Last Name, SSN, Date&Time. I have a report that will show all this information but I would like to put in at calculation to tell the difference between 2...
3
by: Jon Davis | last post by:
The date string: "Thu, 17 Jul 2003 12:35:18 PST" The problem: // this fails on PST DateTime myDate = DateTime.Parse("Thu, 17 Jul 2003 12:35:18 PST"); Help? Jon
7
by: Edward Mitchell | last post by:
I have a number of DateTimePicker controls, some set to dates, some set to a format of Time. The controls are all embedded in dialogs. I created the controls by dragging the DateTime picker from...
5
by: Geoff Jones | last post by:
Hi I have question regarding times and dates in a datatable. I have one table with one column having the date e.g.03/09/04, and another column other the time 08:03:05. The other table has one...
6
by: Scott | last post by:
I have a start date and an end date in my project that is defaulted to the current date at run-time using the following code... Date1.Value = Now() Date2.Value = Now() I then have some code...
4
by: jamesyreid | last post by:
Hi, I'm really sorry to post this as I know it must have been asked countless times before, but I can't find an answer anywhere. Does anyone have a snippet of JavaScript code I could borrow...
44
by: user | last post by:
Hi, Let's say I have 2 dates in the b/m format: Date 1 and date 2 How do I check whether Date2 is later than Date 1? Date1. 21-Nov-2006 09:00:00 PM
3
by: bbawa1 | last post by:
Hi, I have a table which has a field ItemsReceived of type datetime. I have a grid view which has two columns. In first column i have to show the data from field ItemsReceived and in second...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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:
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
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
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...

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.