- 43.7k
- 5
- 107
- 288
PowerShell, (削除) 91 (削除ここまで) (削除) 89 (削除ここまで) 91(削除) 91 (削除ここまで) 56 bytes
date("$args"-replace'th|rd|st|(sun|mon|tues|wednes|thurs|fri|satur\b.*)day(day|,)*'')-f 'yyyyyyyy/MM/dd'dd
Takes input as a string. Uses a -replace to get rid of junk, then uses the built-in Get-Date command with the -format flag to specify the required yyyy/MM/dd format. That string is left on the pipeline and output is implicit.
Saved two bytes thanks to Mr Xcoder. Lost two bytes dueSaved a huge chunk thanks to s/sat/saturTessellatingHeckler's regex golfing.
PowerShell, (削除) 91 (削除ここまで) (削除) 89 (削除ここまで) 91 bytes
date("$args"-replace'th|rd|st|(sun|mon|tues|wednes|thurs|fri|satur)day(,)*')-f 'yyyy/MM/dd'
Takes input as a string. Uses a -replace to get rid of junk, then uses the built-in Get-Date command with the -format flag to specify the required yyyy/MM/dd format. That string is left on the pipeline and output is implicit.
Saved two bytes thanks to Mr Xcoder. Lost two bytes due to s/sat/satur
PowerShell, (削除) 91 (削除ここまで) (削除) 89 (削除ここまで) (削除) 91 (削除ここまで) 56 bytes
date("$args"-replace'th|rd|st|(\b.*)day|,')-f yyyy/MM/dd
Takes input as a string. Uses a -replace to get rid of junk, then uses the built-in Get-Date command with the -format flag to specify the required yyyy/MM/dd format. That string is left on the pipeline and output is implicit.
Saved two bytes thanks to Mr Xcoder. Saved a huge chunk thanks to TessellatingHeckler's regex golfing.
PowerShell, (削除) 91 (削除ここまで) 89(削除) 89 (削除ここまで) 91 bytes
date("$args"-replace'th|rd|st|(sun|mon|tues|wednes|thurs|fri|satsun|mon|tues|wednes|thurs|fri|satur)day(,)*')-f 'yyyy/MM/dd'
Takes input as a string. Uses a -replace to get rid of junk, then uses the built-in Get-Date command with the -format flag to specify the required yyyy/MM/dd format. That string is left on the pipeline and output is implicit.
Saved two bytes thanks to Mr Xcoder. Lost two bytes due to s/sat/satur
PowerShell, (削除) 91 (削除ここまで) 89 bytes
date("$args"-replace'th|rd|st|(sun|mon|tues|wednes|thurs|fri|sat)day(,)*')-f 'yyyy/MM/dd'
Takes input as a string. Uses a -replace to get rid of junk, then uses the built-in Get-Date command with the -format flag to specify the required yyyy/MM/dd format. That string is left on the pipeline and output is implicit.
Saved two bytes thanks to Mr Xcoder.
PowerShell, (削除) 91 (削除ここまで) (削除) 89 (削除ここまで) 91 bytes
date("$args"-replace'th|rd|st|(sun|mon|tues|wednes|thurs|fri|satur)day(,)*')-f 'yyyy/MM/dd'
Takes input as a string. Uses a -replace to get rid of junk, then uses the built-in Get-Date command with the -format flag to specify the required yyyy/MM/dd format. That string is left on the pipeline and output is implicit.
Saved two bytes thanks to Mr Xcoder. Lost two bytes due to s/sat/satur
PowerShell, 91(削除) 91 (削除ここまで) 89 bytes
date("$args"-replace'th|rd|st|(sun|mon|tues|wednes|thurs|fri|sat)day(,)*')-f 'yyyy/MM/dd'
Takes input as a string. Uses a -replace to get rid of junk, then uses the built-in Get-Date command with the -format flag to specify the required yyyy/MM/dd format. That string is left on the pipeline and output is implicit.
Try it online! Saved two bytes thanks to Mr Xcoder.
PowerShell, 91 bytes
date("$args"-replace'th|rd|st|(sun|mon|tues|wednes|thurs|fri|sat)day(,)*')-f 'yyyy/MM/dd'
Takes input as a string. Uses a -replace to get rid of junk, then uses the built-in Get-Date command with the -format flag to specify the required yyyy/MM/dd format. That string is left on the pipeline and output is implicit.
PowerShell, (削除) 91 (削除ここまで) 89 bytes
date("$args"-replace'th|rd|st|(sun|mon|tues|wednes|thurs|fri|sat)day(,)*')-f 'yyyy/MM/dd'
Takes input as a string. Uses a -replace to get rid of junk, then uses the built-in Get-Date command with the -format flag to specify the required yyyy/MM/dd format. That string is left on the pipeline and output is implicit.
Saved two bytes thanks to Mr Xcoder.