Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, is there a way to specify the template that getdate() uses in the source code? I'd like to provide it the string "11/22/2005 12PM" to get the appropriate tm ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    Location
    Wisconsin
    Posts
    942

    getdate in C


    Hi, is there a way to specify the template that getdate() uses in the source code? I'd like to provide it the string "11/22/2005 12PM" to get the appropriate tm structure.

    Thanks in advance!

  2. #2
    Linux User
    Join Date
    Jul 2004
    Location
    Poland
    Posts
    368
    Look for strptime() function:
    man 3 strptime
    "I don't know what I'm running from
    And I don't know where I'm running to
    There's something deep and strange inside of me I see"

  3. #3
    Linux Newbie
    Join Date
    Oct 2004
    Posts
    158
    POSIX getdate uses the DATEMSK environment variable to identify the file with input format templates. It requires a file.

    Asm entioned you can dio the same thing"in code" with strptime().

Posting Permissions

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