cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Discussions

Solve problems, and share tips and tricks with other JMP users.
%3CLINGO-SUB%20id%3D%22lingo-sub-550053%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EUmwandlung%20von%20AM%2FPM%20in%20das%2024-Stunden-Format%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550053%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EHallo%20JMP-Benutzer%2C%3C%2FP%3E%3CP%3EK%C3%B6nnen%20Sie%20bitte%20vorschlagen%2C%20wie%20man%20die%20Zeit%20AM%2FPM%20in%20das%2024-Stunden-Format%20umwandelt%3F%3C%2FP%3E%3CP%3EIn%20der%20folgenden%20Tabelle%20befindet%20sich%20Spalte%201%20im%20Datentyp%20%22Zeichen%22%20und%20ich%20m%C3%B6chte%20sie%20in%20das%2024-Stunden-Format%20(h%3Am%3As)%20konvertieren.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22chandankishor66_0-1664360632850.png%22%20style%3D%22width%3A%20147px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F45866iAA691940AFF240B8%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22chandankishor66_0-1664360632850.png%22%20alt%3D%22chandankishor66_0-1664360632850.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EGr%C3%BC%C3%9Fe%2C%3C%2FP%3E%3CP%3EChandan%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-550053%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CLINGO-LABEL%3ESkripterstellung%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-550057%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Umwandlung%20von%20AM%2FPM%20in%2024-Stunden-Format%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-550057%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3EWenn%20deine%20Daten%20immer%20so%20sind%20und%20du%20nur%20die%20Stunden%20willst%2C%20w%C3%BCrde%20ich%20Formel%20mit%20Word%20oder%20Words%20verwenden%20und%20dann%20einfach%20die%20Werte%20zusammenrechnen.%20Ein%20Beispiel%20unten%3A%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENum(Word(1%2C%20%3AColumn%201))%20%2B%20If(Word(2%2C%20%3AColumn%201)%20%3D%3D%20%22PM%22%2C%2012%2C%200)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-551481%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3EBetreff%3A%20Umwandlung%20von%20AM%2FPM%20in%2024-Stunden-Format%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-551481%22%20slang%3D%22en-US%22%20mode%3D%22NONE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F14366%22%20target%3D%22_blank%22%3E%40jthi%3C%2FA%3E%20gab%20Ihnen%20eine%20gute%20Antwort%20f%C3%BCr%20genau%20das%2C%20was%20Sie%20tun%20wollten.%20Es%20empfiehlt%20sich%20jedoch%2C%20eine%20Speicherzeit%20in%20einer%20Zeitspalte%20zu%20verwenden.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EErfahren%20Sie%20mehr%20dar%C3%BCber%2C%20wie%20das%20geht%3A%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMPer-Cable%2FUsing-dates-times-datetimes-and-durations-in-JMP%2Fm-p%2F68689%23U68689%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-blog-thread%20lia-fa-icon%20lia-fa-blog%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3E%20Verwenden%20von%20Datumsangaben%2C%20Uhrzeiten%2C%20Datumszeiten%20und%20Dauer%20in%20JMP%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar
chandankishor66
Level III

Conversion of AM/PM to 24 hrs format

Hello JMP user,

Can you please suggest how to convert the time AM/PM to 24 hrs format.

In below table, column 1 is in "Character" Data Type and I want to convert it in 24hrs (h:m:s) format. 

 

chandankishor66_0-1664360632850.png

Regards,

Chandan

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Conversion of AM/PM to 24 hrs format

If your data is always like that and you just want the hours, I would use formula with Word or Words and then just calculate the values together. One example below:

Num(Word(1, :Column 1)) + If(Word(2, :Column 1) == "PM", 12, 0);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Conversion of AM/PM to 24 hrs format

If your data is always like that and you just want the hours, I would use formula with Word or Words and then just calculate the values together. One example below:

Num(Word(1, :Column 1)) + If(Word(2, :Column 1) == "PM", 12, 0);
-Jarmo
Jeff_Perkinson
Community Manager Community Manager

Re: Conversion of AM/PM to 24 hrs format

@jthi gave you a good answer for exactly what you were looking to do. However, it's a good practice to use a store times in a time column. 

 

Learn more about how to do that: Using dates, times, datetimes and durations in JMP 

-Jeff

Recommended Articles