Get current GMT Time in Oracle and MSSQL
Posted on 5/14/2008 3:05:58 AM
in #SQL SERVER
Hi,
Many a time with all the data we want to store the current date time for reference purpose. /SPAN>If your application is going to work with more than one country than its best to store the date time in UTC (GMT) format. /SPAN>With difference database the way to get the current UTC date time is different. Here is a list of way to do the same for different database./P>
Oracle 9i and above/P>
select new_time(sysdate,'EST','GMT') into Result /SPAN>from dual;/P>
Don’t forget to change EST with the current time zone of the database./P>
MS SQL 200 and above/P>
GETUTCDATE()/P>
Remember MS SQL also has GETDATE() function. But the GETDATE() function does not give the UTC (GMT) date time./P>
Vikram/P>
|
Posted on 1/28/2009 9:40:38 PM
Really good. Manual sorting is impressive. But since the datatable used is the same as of the gridview's datasource, I don't understand if this works when I am databinding to the gridview programmatically!
/p>
|