Re: time module methods give an am or pm value ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • dj

    Re: time module methods give an am or pm value ?

    Hello again,

    Does anyone know which method in the time module will generate and am
    or pm ?
    If none of the method will do this for me. Can I produce the value on
    my own ?
    Any suggestions ?
  • Mark Tolonen

    #2
    Re: time module methods give an am or pm value ?


    "dj" <d.a.abernathy@ gmail.comwrote in message
    news:2309efff-5c6b-4434-a2cd-01c3fee86fee@l4 2g2000hsc.googl egroups.com...
    Hello again,
    >
    Does anyone know which method in the time module will generate and am
    or pm ?
    If none of the method will do this for me. Can I produce the value on
    my own ?
    Any suggestions ?
    >>from time import *
    >>strftime('%I: %M:%S %p',localtime(t ime()))
    '07:23:24 AM'
    >>strftime('%I: %M:%S %p',gmtime(time ()))
    '02:23:39 PM'

    -Mark

    Comment

    • Scott David Daniels

      #3
      Re: time module methods give an am or pm value ?

      dj wrote:
      Hello again,
      >
      Does anyone know which method in the time module will generate and am
      or pm ?
      If none of the method will do this for me. Can I produce the value on
      my own ?
      Any suggestions ?
      Read up about strftime (a function, not a method).

      Generally, if you know you'll be using something for more than a few
      uses, it is worth reading the entire documentation for that module.
      People put a fair amount of effort into documentation, and they do it
      to reduce the number of questions they have to answer one user at a
      time. Reading the results of that effort before asking shows courtesy.
      Few people mind explaining unclear documentation when the confusing part
      is identified (and they know the answer). Similarly, asking (5000?, a
      million?) to each spend a second so you can save an hour is bad economics.

      --Scott David Daniels
      Scott.Daniels@A cm.Org

      Comment

      • dj

        #4
        Re: time module methods give an am or pm value ?

        On Jun 7, 9:24 am, "Mark Tolonen" <M8R-yft...@mailinat or.comwrote:
        "dj" <d.a.aberna...@ gmail.comwrote in message
        >
        news:2309efff-5c6b-4434-a2cd-01c3fee86fee@l4 2g2000hsc.googl egroups.com...
        >
        Hello again,
        >
        Does anyone know which method in the time module will generate and am
        or pm ?
        If none of the method will do this for me. Can I produce the value on
        my own ?
        Any suggestions ?
        >from time import *
        >strftime('%I:% M:%S %p',localtime(t ime()))
        '07:23:24 AM'
        >strftime('%I:% M:%S %p',gmtime(time ()))
        >
        '02:23:39 PM'
        >
        -Mark
        Hello Mark,

        Thank you very much. I finally found this function in the
        documentation.

        Comment

        • dj

          #5
          Re: time module methods give an am or pm value ?

          On Jun 7, 9:40 am, Scott David Daniels <Scott.Dani...@ Acm.Orgwrote:
          dj wrote:
          Hello again,
          >
          Does anyone know which method in the time module will generate and am
          or pm ?
          If none of the method will do this for me. Can I produce the value on
          my own ?
          Any suggestions ?
          >
          Read up about strftime (a function, not a method).
          >
          Generally, if you know you'll be using something for more than a few
          uses, it is worth reading the entire documentation for that module.
          People put a fair amount of effort into documentation, and they do it
          to reduce the number of questions they have to answer one user at a
          time. Reading the results of that effort before asking shows courtesy.
          Few people mind explaining unclear documentation when the confusing part
          is identified (and they know the answer). Similarly, asking (5000?, a
          million?) to each spend a second so you can save an hour is bad economics.
          >
          --Scott David Daniels
          Scott.Dani...@A cm.Org
          Hello Scott,

          Thank you very much. I did find this function after shortly after I
          posted this question.
          I appreciated your help :-). And you are right, I do need to be a
          better job of checking
          the documentation, before I post. Thank you again for your help.

          Comment

          Working...