-
Hi Friends,
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.
Thanks,
Jayesh
-
It should be
select to_char(sysdate,'dd-mon-yy hh:mi:ss pm') from dual;
Radhakrishnan.M
-
Hi
Instead of "mm" use "mi"
mm for month and mi for minutes.
-
Hy,
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
A.D.
AD indicator with or without periods.
AM
A.M.
Meridian indicator with or without periods.
BC
B.C.
Day of week (1-7).
DAY
Name of day, padded with blanks to length of 9 characters.
DD
Day of month (1-31).
DDD
Day of year (1-366).
DY
Hour of day (1-12).
HH12
Hour of day (1-24).
HH24
Hour of day (0-23).
IW
4-digit year based on the ISO standard.
J
Minute (0-59).
MM
Month (01-12; JAN = 01)
MON
Abbreviated name of month.
MONTH
Second (0-59).
SSSSS
Year, spelled out; "S" prefixes BC dates with "-".
YYYY
SYYYY
4-digit year; "S" prefixes BC dates with "-".
YYY
YY
Y
-
Hi
I am going to disagree with following
Minute (0-59).
MM
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.
Thanks.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|