Loading ...
Sorry, an error occurred while loading the content.

php Date Time from a given string format

Expand Messages
  • harilalmn1979
    Hello All, My name is Hari, and am from Bangalore. I have been learning php for past one month. It is more of self learning. So, as a beginner in php, I am at
    Message 1 of 3 , Jun 26, 2013
    • 0 Attachment
      Hello All,
      My name is Hari, and am from Bangalore. I have been learning php for past one month. It is more of self learning. So, as a beginner in php, I am at heaven after I saw this group...!! And... this is my first post.

      I am working on a timesheet project with php and mysql.

      I have a php page which has a form in it. The form has a date drop down calendar (http://www.softcomplex.com/products/tigra_calendar/) which, after clicking a date, would give a string like mm/dd/yyyy.

      In the form I also have dropdowns for 'From Time Hours', 'From Time Minutes', 'To Time Hours', 'To Time Minutes'.

      My mysql database has two fields, 'WorkFrom' and 'WorkTo'. To update these fields I am trying to put everything together in the following format;

      yyyy-mm-dd hh:mm:ss

      How can I do it?
    • Sanjay S Nair
      Use http://jqueryui.com/datepicker/ ... -- Sanjay.S.Nair Senior Software Engineer +91 8129 235 898(M) http://in.linkedin.com/pub/sanjay-s-nair/16/700/ba9/
      Message 2 of 3 , Jun 27, 2013
      • 0 Attachment
        Use http://jqueryui.com/datepicker/


        On Thu, Jun 27, 2013 at 10:41 AM, harilalmn1979 <harilalmn1979@...>wrote:

        > **
        >
        >
        > Hello All,
        > My name is Hari, and am from Bangalore. I have been learning php for past
        > one month. It is more of self learning. So, as a beginner in php, I am at
        > heaven after I saw this group...!! And... this is my first post.
        >
        > I am working on a timesheet project with php and mysql.
        >
        > I have a php page which has a form in it. The form has a date drop down
        > calendar (http://www.softcomplex.com/products/tigra_calendar/) which,
        > after clicking a date, would give a string like mm/dd/yyyy.
        >
        > In the form I also have dropdowns for 'From Time Hours', 'From Time
        > Minutes', 'To Time Hours', 'To Time Minutes'.
        >
        > My mysql database has two fields, 'WorkFrom' and 'WorkTo'. To update these
        > fields I am trying to put everything together in the following format;
        >
        > yyyy-mm-dd hh:mm:ss
        >
        > How can I do it?
        >
        >
        >



        --
        Sanjay.S.Nair

        Senior Software Engineer
        +91 8129 235 898(M)
        http://in.linkedin.com/pub/sanjay-s-nair/16/700/ba9/ (LinkedIn)
        http://www.sanjaysnair.com/ (Web)


        [Non-text portions of this message have been removed]
      • Sharad D
        You can use date_parse. to get fields. If you are sure of the fields and orded, you can even explode
        Message 3 of 3 , Jun 27, 2013
        • 0 Attachment
          You can use date_parse. <http://php.net/manual/en/function.date-parse.php> to
          get fields. If you are sure of the fields and orded, you can even explode
          <http://php.net/manual/en/function.explode.php> the string to separate day,
          month and year. Then save it in required format using
          sprintf<http://php.net/manual/en/function.sprintf.php> or
          string concatenation.


          On Thu, Jun 27, 2013 at 2:01 PM, Sanjay S Nair <getsanjaysnair@...>wrote:

          > **
          >
          >
          > Use http://jqueryui.com/datepicker/
          >
          > On Thu, Jun 27, 2013 at 10:41 AM, harilalmn1979 <harilalmn1979@...
          > >wrote:
          >
          > > **
          >
          > >
          > >
          > > Hello All,
          > > My name is Hari, and am from Bangalore. I have been learning php for past
          > > one month. It is more of self learning. So, as a beginner in php, I am at
          > > heaven after I saw this group...!! And... this is my first post.
          > >
          > > I am working on a timesheet project with php and mysql.
          > >
          > > I have a php page which has a form in it. The form has a date drop down
          > > calendar (http://www.softcomplex.com/products/tigra_calendar/) which,
          > > after clicking a date, would give a string like mm/dd/yyyy.
          > >
          > > In the form I also have dropdowns for 'From Time Hours', 'From Time
          > > Minutes', 'To Time Hours', 'To Time Minutes'.
          > >
          > > My mysql database has two fields, 'WorkFrom' and 'WorkTo'. To update
          > these
          > > fields I am trying to put everything together in the following format;
          > >
          > > yyyy-mm-dd hh:mm:ss
          > >
          > > How can I do it?
          > >
          > >
          > >
          >
          > --
          > Sanjay.S.Nair
          >
          > Senior Software Engineer
          > +91 8129 235 898(M)
          > http://in.linkedin.com/pub/sanjay-s-nair/16/700/ba9/ (LinkedIn)
          > http://www.sanjaysnair.com/ (Web)
          >
          > [Non-text portions of this message have been removed]
          >
          >
          >



          --
          Regards

          Sharad D


          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.