What's new

Entware Need help converting dates in shell script

  • Thread starter Deleted member 62525
  • Start date
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

D

Deleted member 62525

Guest
I need some advice from coders here that have been using this version of Linux. I appreciate your help in advance.
Here is this example:

Run command "curl -s -I http://sbc.io/hosts/hosts | grep "[Ll]ast-[Mm]odified" | cut -c16-"
This retrieves Last-Modified time for a specific file. In this case it is a string Tue, 13 Apr 2021 14:04:19 GMT
I would like to convert this string to a format +%Y%m%d%H%M .

It is very easy on macOS/BSD since it does support date converting "from" to "new" format as in
date -jf '%A, %d %B %Y %H:%M:%S %Z' "${mydate}" '+%Y%m%d%H%M'

However on Asus Linux version I am not familiar how this can be converted. Any ideas or suggestions, I would appreciate it. Maybe someone already had solved it or do I need to include some entware lib to help with this work.
 

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top