Thanks R.D
we shd put date inside the quotes otherwise its giving us wrong solution. I
don't know y.
example
declare @Expiredate bigint
select @Expiredate = 1200373200
select dateadd(s,@Expiredate ,01/01/1970)
result : 1938-01-15 05:00:00.000
declare @Expiredate bigint
select @Expiredate = 1200373200
select dateadd(s,@Expiredate ,'01/01/1970')
result : 2008-01-15 05:00:00.000
thanks
vanitha
[quoted text, click to view] "R.D" wrote:
> vanitha try
> declare @Expiredate bigint
> select @Expiredate = 1200373200
> select dateadd(s,@Expiredate ,01/01/1970)
> Regards
> R.D
> "vanitha" wrote:
>
> > Hi friends,
> >
> > I want to convert datetime that is stored as seconds to the actual datetime.
> >
> > Example
> >
> > Expiredate is stored as seconds since 1/1/1970 (ctime)
> >
> > Expiredate = 1200373200
> >
> > convert this to actual datetime
> >
> > Please help me to solve this. It is very urgent.
> >
> > thanks
> > vanitha
you r right vanitha.
if you dont put inside quotes then it treats it as date out of range in sql
server. so starts from base date of sql server.
Regards
R.D
[quoted text, click to view] "vanitha" wrote:
> Thanks R.D
>
> we shd put date inside the quotes otherwise its giving us wrong solution. I
> don't know y.
>
> example
>
> declare @Expiredate bigint
> select @Expiredate = 1200373200
> select dateadd(s,@Expiredate ,01/01/1970)
>
> result : 1938-01-15 05:00:00.000
>
> declare @Expiredate bigint
> select @Expiredate = 1200373200
> select dateadd(s,@Expiredate ,'01/01/1970')
>
> result : 2008-01-15 05:00:00.000
>
> thanks
> vanitha
>
>
>
> "R.D" wrote:
>
> > vanitha try
> > declare @Expiredate bigint
> > select @Expiredate = 1200373200
> > select dateadd(s,@Expiredate ,01/01/1970)
> > Regards
> > R.D
> > "vanitha" wrote:
> >
> > > Hi friends,
> > >
> > > I want to convert datetime that is stored as seconds to the actual datetime.
> > >
> > > Example
> > >
> > > Expiredate is stored as seconds since 1/1/1970 (ctime)
> > >
> > > Expiredate = 1200373200
> > >
> > > convert this to actual datetime
> > >
> > > Please help me to solve this. It is very urgent.
> > >
> > > thanks
> > > vanitha
vanitha
when you get help from news groups, It is your duty to check it as answer.
This will encourage people to answer more quetions. do read help availbe top
right corner.
Regards
R.D
[quoted text, click to view] "vanitha" wrote:
> Hi friends,
>
> I want to convert datetime that is stored as seconds to the actual datetime.
>
> Example
>
> Expiredate is stored as seconds since 1/1/1970 (ctime)
>
> Expiredate = 1200373200
>
> convert this to actual datetime
>
> Please help me to solve this. It is very urgent.
>
> thanks
> vanitha
sure R.D.
I used to do it. this time i just replied back.
thnks
[quoted text, click to view] "R.D" wrote:
> vanitha try
> declare @Expiredate bigint
> select @Expiredate = 1200373200
> select dateadd(s,@Expiredate ,01/01/1970)
> Regards
> R.D
> "vanitha" wrote:
>
> > Hi friends,
> >
> > I want to convert datetime that is stored as seconds to the actual datetime.
> >
> > Example
> >
> > Expiredate is stored as seconds since 1/1/1970 (ctime)
> >
> > Expiredate = 1200373200
> >
> > convert this to actual datetime
> >
> > Please help me to solve this. It is very urgent.
> >
> > thanks
> > vanitha
Vanithaji
I was talking generally, not for my post alone. Any way thanks for that.
Regards
R.D
[quoted text, click to view] "R.D" wrote:
> vanitha
> when you get help from news groups, It is your duty to check it as answer.
> This will encourage people to answer more quetions. do read help availbe top
> right corner.
> Regards
> R.D
>
> "vanitha" wrote:
>
> > Hi friends,
> >
> > I want to convert datetime that is stored as seconds to the actual datetime.
> >
> > Example
> >
> > Expiredate is stored as seconds since 1/1/1970 (ctime)
> >
> > Expiredate = 1200373200
> >
> > convert this to actual datetime
> >
> > Please help me to solve this. It is very urgent.
> >
> > thanks
> > vanitha
The date should really be expressed in "yyyymmdd hh:nn:ss.000" format as
it is unambiguous regardless of locale. For example:
dateadd(s, @Expiredate, '19700101 00:00:00.000')
or
dateadd(s, @Expiredate, '19700101')
--
*mike hodgson*
blog:
http://sqlnerd.blogspot.com [quoted text, click to view] vanitha wrote:
>Thanks R.D
>
>we shd put date inside the quotes otherwise its giving us wrong solution. I
>don't know y.
>
>example
>
>declare @Expiredate bigint
> select @Expiredate = 1200373200
> select dateadd(s,@Expiredate ,01/01/1970)
>
>result : 1938-01-15 05:00:00.000
>
>declare @Expiredate bigint
> select @Expiredate = 1200373200
> select dateadd(s,@Expiredate ,'01/01/1970')
>
>result : 2008-01-15 05:00:00.000
>
>thanks
>vanitha
>
>
>
>"R.D" wrote:
>
>
>
>>vanitha try
>>declare @Expiredate bigint
>>select @Expiredate = 1200373200
>>select dateadd(s,@Expiredate ,01/01/1970)
>>Regards
>>R.D
>>"vanitha" wrote:
>>
>>
>>
>>>Hi friends,
>>>
>>>I want to convert datetime that is stored as seconds to the actual datetime.
>>>
>>>Example
>>>
>>>Expiredate is stored as seconds since 1/1/1970 (ctime)
>>>
>>>Expiredate = 1200373200
>>>
>>>convert this to actual datetime
>>>
>>>Please help me to solve this. It is very urgent.
>>>
>>>thanks
>>>vanitha
>>>
>>>
Help in the top right corner? Only if you're using a web-based
newsreader such as
http://www.microsoft.com/technet/community/newsgroups/dgbrowser/en-us/default.mspx?dg=microsoft.public.sqlserver.server&lang=en&cr=US (Many of us use a real NNTP newsreader, like Mozilla Thunderbird or
Microsoft Outlook Express for example.) ;)
--
*mike hodgson*
blog:
http://sqlnerd.blogspot.com [quoted text, click to view] R.D wrote:
>vanitha
>when you get help from news groups, It is your duty to check it as answer.
>This will encourage people to answer more quetions. do read help availbe top
>right corner.
>Regards
>R.D
>
>"vanitha" wrote:
>
>
>
>>Hi friends,
>>
>>I want to convert datetime that is stored as seconds to the actual datetime.
>>
>>Example
>>
>>Expiredate is stored as seconds since 1/1/1970 (ctime)
>>
>>Expiredate = 1200373200
>>
>>convert this to actual datetime
>>
>>Please help me to solve this. It is very urgent.
>>
>>thanks
>>vanitha
>>
>>
Don't see what you're looking for? Try a search.