change date/time format from yyyymmddHHMMss to dd/mm/yyyy HH:MM:ss

The name of the pictureThe name of the pictureThe name of the pictureClash 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









share|improve this question























  • 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














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









share|improve this question























  • 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












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









share|improve this question















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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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
















  • 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










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'





share|improve this answer




















  • Yay....it worked...thanx alot for your help....
    – Colin
    Sep 11 at 15:06

















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"





share|improve this answer






















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    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






























    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'





    share|improve this answer




















    • Yay....it worked...thanx alot for your help....
      – Colin
      Sep 11 at 15:06














    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'





    share|improve this answer




















    • Yay....it worked...thanx alot for your help....
      – Colin
      Sep 11 at 15:06












    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'





    share|improve this answer












    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'






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Sep 5 at 15:13









    Jeff Schaller

    33k849111




    33k849111











    • 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




    Yay....it worked...thanx alot for your help....
    – Colin
    Sep 11 at 15:06












    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"





    share|improve this answer


























      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"





      share|improve this answer
























        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"





        share|improve this answer














        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"






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Sep 5 at 15:16

























        answered Sep 5 at 15:09









        Stéphane Chazelas

        286k53528866




        286k53528866



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            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













































































            Popular posts from this blog

            How to check contact read email or not when send email to Individual?

            Bahrain

            Postfix configuration issue with fips on centos 7; mailgun relay