Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1107985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:00:53+00:00 2026-05-17T02:00:53+00:00

On Linux you can convert a date like 2010-10-02 to a unix timestamp in

  • 0

On Linux you can convert a date like “2010-10-02” to a unix timestamp in shell script by

date -d "2010-10-02" "+%s"

Since Mac OS does not have the equivalent -d for date. How do you go about converting a date to a unix timestamp in a shell script.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T02:00:53+00:00Added an answer on May 17, 2026 at 2:00 am

    man date on OSX has this example

    date -j -f "%a %b %d %T %Z %Y" "`date`" "+%s"
    

    Which I think does what you want.

    You can use this for a specific date

    date -j -f "%a %b %d %T %Z %Y" "Tue Sep 28 19:35:15 EDT 2010" "+%s"
    

    Or use whatever format you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can we convert mac fonts to pc fonts with the Linux command line or
I'm creating a utility in C++ to be run on Linux which can convert
Under Linux I can issue a gcc -Wl,--defsym,main=main_x .. However in Mac OSX 10
Currently In my embedded linux I can not open multiple ALSA sound stream. What
How can I write human readable timestamp in linux kernel? I think do_gettimeofday returns
I have to convert some C code (that ran in a Linux machine) to
how can i convert my grails application from http to https under Linux operating
How can I convert a .NET exe to Win32 exe? (I don't have the
I need an editor (preferably Linux) which can load OSM maps and allows me
After installing gcc and mpich library in my linux I can compile my codes

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.