select to_char(sysdate,'hh:mm:ss') from dual;
the which it shows is 40 mins lagging than current time on my
operating system . OS time is ture. What should i do so database will show correct time when i perform above query.
It should be
select to_char(sysdate,'dd-mon-yy hh:mi:ss pm') from dual;
Instead of "mm" use "mi"
mm for month and mi for minutes.
I think that was not answers you asking for.
And if I am wright, you should change (set) time on
the comuter where database is. Because SQL function sysdate reading system date and time from the computer where database is instaled, not from your OS.
I hope this is answer you looking for.
And if i am wrong.
This is from manual:
Punctuation and quoted text is reproduced in the result.
AD indicator with or without periods.
Meridian indicator with or without periods.
Day of week (1-7).
Name of day, padded with blanks to length of 9 characters.
Day of month (1-31).
Day of year (1-366).
Hour of day (1-12).
Hour of day (1-24).
Hour of day (0-23).
4-digit year based on the ISO standard.
Month (01-12; JAN = 01)
Abbreviated name of month.
Year, spelled out; "S" prefixes BC dates with "-".
4-digit year; "S" prefixes BC dates with "-".
I am going to disagree with following
I have tried it
select to_char(sysdate,'hh:MM:ss') from dual;
MM will give you month in numeric form. Ex. for Feb. 02
If I am wrong then let me know.
Click Here to Expand Forum to Full Width