change date/time format from yyyymmddHHMMss to dd/mm/yyyy HH:MM:ss
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
How do I change date/time format from yyyymmddHHMMss
to dd/mm/yyyy HH:MM:ss
which is displayed as an output (eg. JOBNAME1 STARTED AT 20180904152402)
from a command...
grep JOBNAME1 | sed -e s/|/ /g | awk print $3,$7,$8,$9 |sort -r -k 4
shell-script command-line scripting date aix
add a comment |Â
up vote
0
down vote
favorite
How do I change date/time format from yyyymmddHHMMss
to dd/mm/yyyy HH:MM:ss
which is displayed as an output (eg. JOBNAME1 STARTED AT 20180904152402)
from a command...
grep JOBNAME1 | sed -e s/|/ /g | awk print $3,$7,$8,$9 |sort -r -k 4
shell-script command-line scripting date aix
Answers to this question unix.stackexchange.com/questions/89568/⦠should get you on the right track.
â Mr Shunz
Sep 5 at 15:22
1
ick, your desired date format is ambiguous
â glenn jackman
Sep 5 at 19:29
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
How do I change date/time format from yyyymmddHHMMss
to dd/mm/yyyy HH:MM:ss
which is displayed as an output (eg. JOBNAME1 STARTED AT 20180904152402)
from a command...
grep JOBNAME1 | sed -e s/|/ /g | awk print $3,$7,$8,$9 |sort -r -k 4
shell-script command-line scripting date aix
How do I change date/time format from yyyymmddHHMMss
to dd/mm/yyyy HH:MM:ss
which is displayed as an output (eg. JOBNAME1 STARTED AT 20180904152402)
from a command...
grep JOBNAME1 | sed -e s/|/ /g | awk print $3,$7,$8,$9 |sort -r -k 4
shell-script command-line scripting date aix
shell-script command-line scripting date aix
edited Sep 5 at 15:13
Jeff Schaller
33k849111
33k849111
asked Sep 5 at 14:59
Colin
1
1
Answers to this question unix.stackexchange.com/questions/89568/⦠should get you on the right track.
â Mr Shunz
Sep 5 at 15:22
1
ick, your desired date format is ambiguous
â glenn jackman
Sep 5 at 19:29
add a comment |Â
Answers to this question unix.stackexchange.com/questions/89568/⦠should get you on the right track.
â Mr Shunz
Sep 5 at 15:22
1
ick, your desired date format is ambiguous
â glenn jackman
Sep 5 at 19:29
Answers to this question unix.stackexchange.com/questions/89568/⦠should get you on the right track.
â Mr Shunz
Sep 5 at 15:22
Answers to this question unix.stackexchange.com/questions/89568/⦠should get you on the right track.
â Mr Shunz
Sep 5 at 15:22
1
1
ick, your desired date format is ambiguous
â glenn jackman
Sep 5 at 19:29
ick, your desired date format is ambiguous
â glenn jackman
Sep 5 at 19:29
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
Painfully ugly awk method:
echo JOBNAME1 STARTED AT 20180904152402 | awk '$4=substr($4,7,2)"/"substr($4,5,2)"/"substr($4,1,4)" "substr($4,9,2)":"substr($4,11,2)":"substr($4,13,2); print'
Yay....it worked...thanx alot for your help....
â Colin
Sep 11 at 15:06
add a comment |Â
up vote
0
down vote
d='([[:digit:]]2)'
sed "s|$d$d$d$d$d$d$d|4/3/12 5:6:7|g"
So for your code:
d='([[:digit:]]2)'
awk -F'|' '/JOBNAME1/ print $3,$7,$8,$9' | sort -rk 4 |
sed "s|$d$d$d$d$d$d$d|4/3/12 5:6:7|g"
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Painfully ugly awk method:
echo JOBNAME1 STARTED AT 20180904152402 | awk '$4=substr($4,7,2)"/"substr($4,5,2)"/"substr($4,1,4)" "substr($4,9,2)":"substr($4,11,2)":"substr($4,13,2); print'
Yay....it worked...thanx alot for your help....
â Colin
Sep 11 at 15:06
add a comment |Â
up vote
0
down vote
Painfully ugly awk method:
echo JOBNAME1 STARTED AT 20180904152402 | awk '$4=substr($4,7,2)"/"substr($4,5,2)"/"substr($4,1,4)" "substr($4,9,2)":"substr($4,11,2)":"substr($4,13,2); print'
Yay....it worked...thanx alot for your help....
â Colin
Sep 11 at 15:06
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Painfully ugly awk method:
echo JOBNAME1 STARTED AT 20180904152402 | awk '$4=substr($4,7,2)"/"substr($4,5,2)"/"substr($4,1,4)" "substr($4,9,2)":"substr($4,11,2)":"substr($4,13,2); print'
Painfully ugly awk method:
echo JOBNAME1 STARTED AT 20180904152402 | awk '$4=substr($4,7,2)"/"substr($4,5,2)"/"substr($4,1,4)" "substr($4,9,2)":"substr($4,11,2)":"substr($4,13,2); print'
answered Sep 5 at 15:13
Jeff Schaller
33k849111
33k849111
Yay....it worked...thanx alot for your help....
â Colin
Sep 11 at 15:06
add a comment |Â
Yay....it worked...thanx alot for your help....
â Colin
Sep 11 at 15:06
Yay....it worked...thanx alot for your help....
â Colin
Sep 11 at 15:06
Yay....it worked...thanx alot for your help....
â Colin
Sep 11 at 15:06
add a comment |Â
up vote
0
down vote
d='([[:digit:]]2)'
sed "s|$d$d$d$d$d$d$d|4/3/12 5:6:7|g"
So for your code:
d='([[:digit:]]2)'
awk -F'|' '/JOBNAME1/ print $3,$7,$8,$9' | sort -rk 4 |
sed "s|$d$d$d$d$d$d$d|4/3/12 5:6:7|g"
add a comment |Â
up vote
0
down vote
d='([[:digit:]]2)'
sed "s|$d$d$d$d$d$d$d|4/3/12 5:6:7|g"
So for your code:
d='([[:digit:]]2)'
awk -F'|' '/JOBNAME1/ print $3,$7,$8,$9' | sort -rk 4 |
sed "s|$d$d$d$d$d$d$d|4/3/12 5:6:7|g"
add a comment |Â
up vote
0
down vote
up vote
0
down vote
d='([[:digit:]]2)'
sed "s|$d$d$d$d$d$d$d|4/3/12 5:6:7|g"
So for your code:
d='([[:digit:]]2)'
awk -F'|' '/JOBNAME1/ print $3,$7,$8,$9' | sort -rk 4 |
sed "s|$d$d$d$d$d$d$d|4/3/12 5:6:7|g"
d='([[:digit:]]2)'
sed "s|$d$d$d$d$d$d$d|4/3/12 5:6:7|g"
So for your code:
d='([[:digit:]]2)'
awk -F'|' '/JOBNAME1/ print $3,$7,$8,$9' | sort -rk 4 |
sed "s|$d$d$d$d$d$d$d|4/3/12 5:6:7|g"
edited Sep 5 at 15:16
answered Sep 5 at 15:09
Stéphane Chazelas
286k53528866
286k53528866
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f467037%2fchange-date-time-format-from-yyyymmddhhmmss-to-dd-mm-yyyy-hhmmss%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Answers to this question unix.stackexchange.com/questions/89568/⦠should get you on the right track.
â Mr Shunz
Sep 5 at 15:22
1
ick, your desired date format is ambiguous
â glenn jackman
Sep 5 at 19:29