Jump to content

Php Date and Hours


Sweets287

Recommended Posts

Hi All!!

 

I have some php script in a program I use and I'm struggling to change it. It works fine Getting the personId for any details less than 1 day old, but I want to change it to any details less than 1 hour old. I've tried changing DATEADD(d,-1,getdate()) to DATEADD(h,-1,getdate()) and googling other things but still stumped

 

Any Ideas?

 

select 

    PersonId

    dReceievedDate = cast(YEAR(dReceievedDate) as varchar(4))+'-'+ RIGHT(CAST(MONTH(dReceievedDate) as varchar(2)),2)+'-'+ RIGHT(CAST(DAY(dReceievedDate) as varchar(2)),2)

from 

peopletbl

where dReceievedDate >DATEADD(d,-1,getdate())

order by PersonId DESC

 

Link to comment
https://forums.phpfreaks.com/topic/282571-php-date-and-hours/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.