how to get present time and date?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vin2sara
    New Member
    • Aug 2006
    • 1

    how to get present time and date?

    Hi,

    Can anyone send a query to get present date and time ??I used dateformat method ,but i am not getting that.please its very urgent to me...

    Thank You
  • Bhanu Murthy
    New Member
    • Aug 2006
    • 17

    #2
    Originally posted by vin2sara
    Hi,

    Can anyone send a query to get present date and time ??I used dateformat method ,but i am not getting that.please its very urgent to me...

    Thank You
    Hello My dear,

    select TO_CHAR(new_tim e(sysdate,'GMT' ,'PST'), 'DD-MON-YYYY HH:MI:SS') FROM DUAL;

    You try the above... this solves your problem.
    Bhanu Murthy
    Last edited by Frinavale; Aug 3 '12, 01:30 PM.

    Comment

    • vssp
      Contributor
      • Jul 2006
      • 268

      #3
      hai try this query

      SELECT NOW(), SLEEP(2), NOW();
      Last edited by Frinavale; Aug 3 '12, 01:31 PM.

      Comment

      • Bhanu Murthy
        New Member
        • Aug 2006
        • 17

        #4
        Originally posted by vssp
        hai try this query

        SELECT NOW(), SLEEP(2), NOW();
        Sorry, This does not work. ... I am afraid, which ORACLE version r u using. .. May be you are using latest version... I am still using oracle 8.0.3.0.

        Comment

        • Bhanu Murthy
          New Member
          • Aug 2006
          • 17

          #5
          Please try the following: (I found you have not opened the forum)

          select TO_CHAR(new_tim e(sysdate,'GMT' ,'PST'), 'DD-MON-YYYY HH:MI:SS') FROM DUAL;

          You try the above... this solves your problem.
          Bhanu Murthy
          Last edited by Frinavale; Aug 3 '12, 01:31 PM.

          Comment

          • vampirus87
            New Member
            • Oct 2008
            • 1

            #6
            Originally posted by Bhanu Murthy
            Please try the following: (I found you have not opened the forum)

            select TO_CHAR(new_tim e(sysdate,'GMT' ,'PST'), 'DD-MON-YYYY HH:MI:SS') FROM DUAL;

            You try the above... this solves your problem.
            Bhanu Murthy
            Dear Mr. Bhanu Murthy,

            Thank you for your kind reply. I have an enquiry regarding the time finding query. If I want to do a database to take the attendance of school children, i.e. let them key in their ID and select IN or OUT option. When they choose one of the option the system automatically stores the current time. How do I code for this?
            Last edited by Frinavale; Aug 3 '12, 01:31 PM.

            Comment

            • debasisdas
              Recognized Expert Expert
              • Dec 2006
              • 8119

              #7
              you need to use SYSDATE for the purpose and set the default vaule of the DATE field to sysdate.

              Comment

              • sheshk11
                New Member
                • Nov 2011
                • 1

                #8
                Hello sir

                select TO_CHAR(new_tim e(sysdate,'GMT' ,'PST'), 'DD-MON-YYYY HH:MI:SS') FROM DUAL;

                You try the above... this solves your problem.
                Bhanu Murthy
                Sir, that code you mentioned above retrieves the time of when the database was installed and its a time consuming and too complicated. Here, you can try this code if you please to; select systimestamp from dual;
                Last edited by Frinavale; Aug 3 '12, 01:32 PM.

                Comment

                • udarajag
                  New Member
                  • Aug 2012
                  • 1

                  #9
                  select SYSTIMESTAMP from dual; this would do the trick
                  Last edited by Frinavale; Aug 3 '12, 01:32 PM.

                  Comment

                  • bharthi
                    New Member
                    • Jun 2012
                    • 20

                    #10
                    use this query to see present data and time,

                    select systimestamp from dual;

                    Comment

                    • mit dahime
                      New Member
                      • Aug 2012
                      • 3

                      #11
                      you try this
                      SELECT to_char(sysdate ,'GMT','PST'), 'DD-MON-YYYY HH:MI:SS') FROM DUAL;

                      Comment

                      Working...