Hi
Im getting a YouTube timeduraion for my videos in PT1H32S
How do i convert that to normal minutes and seconds… ??
I’ve tried with the following :
{{formatDate(parseNumber(replace(replace(21.$1
; “PT”; ); “S”; )); “00:00”)}}
Hi
Im getting a YouTube timeduraion for my videos in PT1H32S
How do i convert that to normal minutes and seconds… ??
I’ve tried with the following :
{{formatDate(parseNumber(replace(replace(21.$1
; “PT”; ); “S”; )); “00:00”)}}
If you trying to parse “PT< hr >H< min >M< sec >S”
You can use this Regex Pattern,
PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?
in a Text Parser Match Pattern like below:
It will result you $1,$2,$3 as hours, minutes, seconds respectively.
Best regards,
Msquare Automation
Platinum Partner of Make
@Msquare_Automation
Welcome to the Make community!
You can use a Text Parser “Match Pattern” module with this Pattern (regular expression):
^PT(?:(?<hour>\d+)H)?(?:(?<min>\d+)M)?(?:(?<sec>\d+)S)?$
Proof https://regex101.com/r/PG9DNp/1
For more information, see the Text Parser page in the Make Help Center:
Match Pattern
The Match pattern module enables you to find and extract string elements matching a search pattern from a given text. The search pattern is a regular expression, which is a sequence of characters in which each character is either a metacharacter, having a special meaning, or a regular character that has a literal meaning.
- The complete list of metacharacters can be found on the MDN web docs website.
- For a tutorial on how to create regular expressions, we recommend the RegexOne website.
- For an easy, quick regex generator, try the Regular Expressions generator.
- For experimenting with regular expressions, we recommend the regular expressions 101 website. Just make sure to select the ECMAScript (JavaScript) flavour in the left panel.
Hope this helps! Let me know if there are any further questions or issues.
— @samliew
P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.