Solved

Convert date format in BASH

Posted on 2014-02-10
2
1,142 Views
Last Modified: 2014-02-10
Hi,

On RHEL 5.10

I'm looking for a way to convert date format.
for exmple from this: 10-FEB-2014/13:12
to this:                          20140210-1312
0
Comment
Question by:peledc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 31

Accepted Solution

by:
farzanj earned 100 total points
ID: 39847248
Try
DATE=$(echo 10-FEB-2014/13:12 | sed 's/[-\/]/ /g')
date -d "$DATE" +"%Y%m%d-%H%M"

Open in new window

0
 
LVL 6

Expert Comment

by:Shiju Jacob
ID: 39847258
date  +"%Y%m%d-%H%M"
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question