Save in DB as seconds since 1970

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?U2hlbGRvbg==?=

    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
  • Teme64

    #2
    Re: Save in DB as seconds since 1970

    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
    Unix and Unix-like systems, like Linuxes, use Unix Epoch time in system time and time handling libraries. Sometimes you may need to handle t...



    Teme64 @ http://windevblog.blogspot.com

    Comment

    Working...