SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need some help with time formatting

    Hi, i'm currently working on an extension for a content management system. Times entered through the system's backend are inserted into the database in the following format:

    Code:
    34200
    To keep everything consistent I want my code to enter times in the same format but I'm having trouble replicating it.

    This is the code i'm using to generate my time:

    PHP Code:
    $etime strtotime("+" $count " minutes"$ticket_start); 
    Which outputs the time as:

    Code:
    1315645200
    I've had a look through the documentation for the CMS, but it's not particually well documented in English.

    Can anyone on here tell me just from looking at the time string how I can replicate the format?

    Thanks

  2. #2
    @php.net Salathe's Avatar
    Join Date
    Dec 2004
    Location
    Edinburgh
    Posts
    1,396
    Mentioned
    54 Post(s)
    Tagged
    0 Thread(s)
    What time does 34200 represent?
    Salathe
    Software Developer and PHP Manual Author.

  3. #3
    SitePoint Member
    Join Date
    Apr 2010
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    10:30. Output from the following code:

    PHP Code:
    echo date('H:i'34200); 

  4. #4
    SitePoint Addict
    Join Date
    Dec 2005
    Posts
    336
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    What CMS and have you viewed the file(s) in the CMS that generate the time?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •