473,386 Members | 2,129 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.

Save in DB as seconds since 1970

Hello -

I have two datetimepickers, depicting login and logout times. I retrieved
the information which is stored in the database as the number of seconds
since 1970 and formatted it in Sql Server as:
Select dateadd(ss, MIN(Login), '1970') as Login,
dateadd(ss, MAX(Logout), '1970') as Logout
FROM etc.

I stored the values in two textboxes and set the datetimepickers to the
value in the textboxes and then formatted them in the datetimepickers as
HH:mm:ss so the user sees, for example, 09:30:00 indicating they had started
work at 9:30.

Now I need to allow the user to change that value and save it back to the
database. How do I do that? Is there a way of converting it in visual basic
2008 or converting it in Sql Server in an insert statement?

Any clues are appreciated!
--
Sheldon
Nov 8 '08 #1
1 1729
Sheldon wrote:
Hello -

I have two datetimepickers, depicting login and logout times. I retrieved
the information which is stored in the database as the number of seconds
since 1970 and formatted it in Sql Server as:
Select dateadd(ss, MIN(Login), '1970') as Login,
dateadd(ss, MAX(Logout), '1970') as Logout
FROM etc.

I stored the values in two textboxes and set the datetimepickers to the
value in the textboxes and then formatted them in the datetimepickers as
HH:mm:ss so the user sees, for example, 09:30:00 indicating they had started
work at 9:30.

Now I need to allow the user to change that value and save it back to the
database. How do I do that? Is there a way of converting it in visual basic
2008 or converting it in Sql Server in an insert statement?

Any clues are appreciated!

--
You're using Unix style epoch time? Here's the VB.NET routines to convert
between epoch time and VB date
http://windevblog.blogspot.com/2008/...-in-vbnet.html
Teme64 @ http://windevblog.blogspot.com
Nov 9 '08 #2

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

Similar topics

9
by: shoba | last post by:
hi i'm provided with time in seconds. this is the time elapsed from the midnight to jan 1970 till certain date. i would like to know how to determine that date using this time thanks in...
3
by: kaming | last post by:
Dear all, Do any one have idea how to obtain the exactly number of seconds in a month with given month and year using DB2 given functions? The formula is as simple as "No_of_days_for_a_month" *...
4
by: cyril | last post by:
I saw that is a recurrent message but i couln't succed in founding the solution ... I'm developping under Linux Does anyone have a code snippet that permit to get in a simple long var the...
5
by: David Requena | last post by:
Hi All, I'm trying to parse a file which has some timestamps embedded. These're expressed as a number of seconds elapsed since 01/01/1904 (macintosh time). I know OS X provides some APIs to...
5
by: Terry Diederich | last post by:
I need to pull some data out of a database where the date fields are being stored as long integers which represent the number of seconds since midnight Jan 1, 1970. I need to convert these values...
1
by: Liviu BURCUSEL | last post by:
Hello ! It is late night and I cannot think right anymore. Please help me to convert a interval like '2 days 00:22:10.2905' in seconds. Thank you very much in advance, Liviu ...
4
by: Dr John Stockton | last post by:
I'm starting a new thread, for clarity. I'm assuming that it's ECMA-262 3rd Edn (1999) that we should be using for Web pages; that 4th Edn (what's its present status? is it available?) is too...
3
by: eur.van.andel | last post by:
Hi all How can I access partial seconds on the system clock? I measure air speed and water flow in a heat-exchanger test stand and count pulses from both water meter and air speed meter. I...
8
by: vunet.us | last post by:
How can I convert today's time (9:30:00) to seconds (34200) without using calculations like (9*3600)+(30*60)+0? Is there an easy function? Thank you
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
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
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
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...

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.