How To Add Hours/Minutes/Seconds to a Particular Date having 24/May/2013 1730
select to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') "Current Date",
to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') + 1 / 24 "Adding Hours",
to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') + 55 / 1440 "Adding Minutes",
to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') + 1 / 86400 "Adding Seconds"
from dual;
to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') + 1 / 24 "Adding Hours",
to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') + 55 / 1440 "Adding Minutes",
to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') + 1 / 86400 "Adding Seconds"
from dual;
select to_date('24/May/2013 1730:00','dd/Mon/yyyy hh24mi:ss') from dual
select to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') +45 / 1440 from dual
select to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') +45 / 1440 from dual
'dd/Mon/yyyy hh24mi') "Current Date",
to_char(to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') + 1 / 24,
'dd/Mon/yyyy hh24mi') "Adding Hours",
to_char(to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') +
55 / 1440,
'dd/Mon/yyyy hh24mi') "Adding Minutes",
to_char(to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') +
1 / 86400,
'dd/Mon/yyyy hh24mi') "Adding Seconds"
from dual;
select to_char(to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi'),
'dd/Mon/yyyy hh24mi') "Actual Date",
to_char(to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') + 3 / 24,
'dd/Mon/yyyy hh24mi') "Adding 3 Hours",
to_char(to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') +
55 / 1440,
'dd/Mon/yyyy hh24mi') "Adding 55 Minutes",
to_char(to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') +
10 / 86400,
'dd/Mon/yyyy hh24mi') "Adding 10 Seconds"
from dual;
'dd/Mon/yyyy hh24mi') "Actual Date",
to_char(to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') + 3 / 24,
'dd/Mon/yyyy hh24mi') "Adding 3 Hours",
to_char(to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') +
55 / 1440,
'dd/Mon/yyyy hh24mi') "Adding 55 Minutes",
to_char(to_date('24/May/2013 1730', 'dd/Mon/yyyy hh24mi') +
10 / 86400,
'dd/Mon/yyyy hh24mi') "Adding 10 Seconds"
from dual;
No comments:
Post a Comment