How to store global date time and convert it to local date time?

Who do I convert "noon oct 21" to a date time linux and compare it with current date time?

  • I need to write a shell script that will take the date time from arg and when that date and time is reached, the shell needs to do something. The date time in the arg is in this ...show more

  • Answer:

    The date(1) command may have a parameter to interpret this free format description. For example: date --date "noon oct 21" If so, you can use the format string (+ then % letter - one is seconds since 1970) to output the date as an absolute number of seconds. That can be compared with the current date/time. But personally I'd be looking at converting this free format into a format that at(1) can understand and let your server handle the scheduling automatically.

FHMUFEJC6GXFHNSEFYQNWFHKO4 at Yahoo! Answers Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.