Riding The Breeze

Jump to content

Additional information

Categories


MSSQL | Convert unix timestamp to date

Apr 2007
24

select dateadd(ss, {field_name}, '19700101')


2 Comments

  1. # Bev Scott on May 16th, 2007

    When I use the following function.

    The date is one day ahead of what it should be.
    It does not show any time.

    SELECT DATEADD(SECOND, 1179367200, '19700101') as realdate

    returns
    2007-05-17 02:00:00.000

    the date and time should be
    2007-05-16 7:00 pm

    select dateadd(ss, {field_name}, ‘19700101′)

    Can anyone help me with this.

  2. # simone on May 18th, 2007

    Hello. Why do you say that

    SELECT DATEADD(SECOND, 1179367200, ‘19700101′) as realdate

    should returns 2007-05-16 7:00 pm ?

    If I convert 1179367200 I get Thu, 17 May 2007 04:00:00 +0200


Your Comment

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>




Credits

Template designed by praegnanz.de.