How to get timestamp using libc

About Monkey 2 Forums Monkey 2 Code Library How to get timestamp using libc

Tagged: , ,

This topic contains 2 replies, has 3 voices, and was last updated by  cocon 1 week, 1 day ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #15541

    Nalle
    Participant

    Hello, here’s my little code to get the timestamp by the year / month / day / hour / min / sec.

    I’m using libc.

    The output of mine was:

    46-42-7-26-10-2018

    Year: 2018
    Month: 10
    Day: 26
    Hour: 7
    Min: 42
    Sec: 46

    Hope many people will find this useful!

    #15552

    nerobot
    Participant

    Nice. But timestamp format looks like

    yyyy-mm-dd hh:mm:ss

    2018-11-01 18:36:10

    🙂

    Easy to adopt your code to that.

    #15577

    cocon
    Participant

    Perhaps we could create a time module that contains all of that formatting.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.