René's URL Explorer Experiment


Title: Add One New DateTime Parsing Format · Issue #11719 · PowerShell/PowerShell · GitHub

Open Graph Title: Add One New DateTime Parsing Format · Issue #11719 · PowerShell/PowerShell

X Title: Add One New DateTime Parsing Format · Issue #11719 · PowerShell/PowerShell

Description: Yesterday I posted a suggestion that we have a new special format for Get-Date that creates the SecondsSinceEpoch (aka UnixTime) for users. Additionally I think we should have built into the language the ability to easily parse a UnixEpo...

Open Graph Description: Yesterday I posted a suggestion that we have a new special format for Get-Date that creates the SecondsSinceEpoch (aka UnixTime) for users. Additionally I think we should have built into the langua...

X Description: Yesterday I posted a suggestion that we have a new special format for Get-Date that creates the SecondsSinceEpoch (aka UnixTime) for users. Additionally I think we should have built into the langua...

Opengraph URL: https://github.com/PowerShell/PowerShell/issues/11719

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add One New DateTime Parsing Format","articleBody":"Yesterday I posted a suggestion that we have a new special format for Get-Date that creates the SecondsSinceEpoch (aka UnixTime) for users.\r\n\r\nAdditionally I think we should have built into the language the ability to easily parse a UnixEpoch timestamp back into a DateTime.\r\n\r\nVarious existing parsing that works today:\r\n```\r\n$aDate = [DateTime]\"2020-01-28T17:32:18.4986003-06:00\" #  (conversion back from the format of Format \"o\")\r\n$bDate = [DateTime]\"2020-01-28T17:36:39\" #  (conversion back from the format of Format \"s\")\r\n$cDate = [DateTime]\"Tue, 28 Jan 2020 17:37:43 GMT\" #  (conversion back from the format of Format \"r\")\r\n$dDate = [DateTime]\"2020-01-28 17:38:24Z\" #  (conversion back from the format of Format \"u\")\r\n$eDate = [DateTime]\"7/25/2013 6:37:31 PM\" \r\n$fDate = [DateTime]\"2013-07-25 14:26:00\" \r\n$gDate = [DateTime]\"7/25/2013 14:26:00\"\r\n$hDate = [DateTime]\"2013-07-25 6:37:31 PM\"\r\n```\r\nBut we can't currently put in $AUnixDate = [DateTime]\"1374755180\" and end up with a valid DateTime object (which would be of UTC kind)\r\n\r\nA discussion by Randy James at https://stackoverflow.com/questions/17859421/parse-datetime-in-multiple-formats suggests perhaps something along these lines for processing this in another language:\r\n```\r\npublic DateTime ParseRequestDate()\r\n{\r\n    // https://stackoverflow.com/questions/2883576/how-do-you-convert-epoch-time-in-c\r\n\r\n    CultureInfo enUS = new CultureInfo(\"en-US\");\r\n\r\n    var dt = \"1374755180\";\r\n    //var dt = \"7/25/2013 6:37:31 PM\";\r\n    //var dt = \"2013-07-25 14:26:00\";\r\n\r\n    DateTime dateValue;\r\n    long dtLong;\r\n\r\n    // Scenario #1\r\n    if (long.TryParse(dt, out dtLong))\r\n        return dtLong.FromUnixTime();\r\n\r\n    // Scenario #2 & #3\r\n    var formatStrings = new string[] { \"MM/dd/yyyy hh:mm:ss tt\", \"yyyy-MM-dd hh:mm:ss\" };\r\n    if (DateTime.TryParseExact(dt, formatStrings, enUS, DateTimeStyles.None, out dateValue))\r\n        return dateValue;\r\n\r\n    throw new SomeException(\"Don't know how to parse...\");\r\n}\r\n\r\n```\r\n","author":{"url":"https://github.com/scotthardwick","@type":"Person","name":"scotthardwick"},"datePublished":"2020-01-29T15:07:01Z","url":"https://github.com/PowerShell/PowerShell/issues/11719"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9747f9b2-9182-8ce7-1c56-8b1c19023539
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC210:160FD0:2B2FBD7:3C3F889:6AFD5D22
html-safe-noncef99b864d78a9cd89d8efab2343d29298488b8c03f54d7349a9c0656b3e80ce36
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjEwOjE2MEZEMDoyQjJGQkQ3OjNDM0Y4ODk6NkFGRDVEMjIiLCJ2aXNpdG9yX2lkIjoiODY3MDMxMDI0NjcwMDExMzE4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac169b3039318bf22ef8cd30e47ad59151cc954db9191cbc4168f91f392dc3d81b
hovercard-subject-tagissue:556923177
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/11719/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f4e37f0097a40093db2bba35327246621777089ff9132ca8b507372df9c35094/PowerShell/PowerShell/issues/11719
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f4e37f0097a40093db2bba35327246621777089ff9132ca8b507372df9c35094/PowerShell/PowerShell/issues/11719
og:image:altYesterday I posted a suggestion that we have a new special format for Get-Date that creates the SecondsSinceEpoch (aka UnixTime) for users. Additionally I think we should have built into the langua...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamescotthardwick
hostnamegithub.com
expected-hostnamegithub.com
None66653c2e55a6fff2930be1bdf07ee4f8aa137e3956d056c822563be6f878755e
turbo-cache-controlno-preview
go-importgithub.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git
octolytics-dimension-user_id11524380
octolytics-dimension-user_loginPowerShell
octolytics-dimension-repository_id49609581
octolytics-dimension-repository_nwoPowerShell/PowerShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49609581
octolytics-dimension-repository_network_root_nwoPowerShell/PowerShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseb6f01f7cb9f35f8c09949773241a3d49dd04b340
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/PowerShell/PowerShell/issues/11719#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F11719
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FPowerShell%2FPowerShell%2Fissues%2F11719
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=PowerShell%2FPowerShell
Reloadhttps://github.com/PowerShell/PowerShell/issues/11719
Reloadhttps://github.com/PowerShell/PowerShell/issues/11719
Reloadhttps://github.com/PowerShell/PowerShell/issues/11719
PowerShellhttps://github.com/PowerShell
PowerShellhttps://github.com/PowerShell/PowerShell
Codehttps://github.com/PowerShell/PowerShell
Issues1.3k (1.3k)https://github.com/PowerShell/PowerShell/issues
Pull requests365 (365)https://github.com/PowerShell/PowerShell/pulls
Discussionshttps://github.com/PowerShell/PowerShell/discussions
Actionshttps://github.com/PowerShell/PowerShell/actions
Projectshttps://github.com/PowerShell/PowerShell/projects
Security and quality3 (3)https://github.com/PowerShell/PowerShell/security
Insightshttps://github.com/PowerShell/PowerShell/insights
https://github.com/PowerShell/PowerShell
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/11719
New issuehttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/11719
#12179https://github.com/PowerShell/PowerShell/pull/12179
Add One New DateTime Parsing Formathttps://github.com/PowerShell/PowerShell/issues/11719#top
#12179https://github.com/PowerShell/PowerShell/pull/12179
Issue-Enhancementthe issue is more of a feature request than a bughttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
WG-Cmdletsgeneral cmdlet issueshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Cmdlets%22
https://github.com/scotthardwick
Scott Hardwick (scotthardwick)https://github.com/scotthardwick
on Jan 29, 2020https://github.com/PowerShell/PowerShell/issues/11719#issue-556923177
https://stackoverflow.com/questions/17859421/parse-datetime-in-multiple-formatshttps://stackoverflow.com/questions/17859421/parse-datetime-in-multiple-formats
Scott Hardwick (scotthardwick)https://github.com/scotthardwick
Issue-Enhancementthe issue is more of a feature request than a bughttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
on Jan 29, 2020https://github.com/PowerShell/PowerShell/issues/11719#event-2989872572
Ilya (iSazonov)https://github.com/iSazonov
Area-Cmdlets-Utilityhttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Area-Cmdlets-Utility%22
on Jan 30, 2020https://github.com/PowerShell/PowerShell/issues/11719#event-2991856363
https://github.com/iSazonov
Ilya (iSazonov)https://github.com/iSazonov
on Jan 30, 2020https://github.com/PowerShell/PowerShell/issues/11719#issuecomment-580068617
Steve Lee (@SteveL-MSFT)https://github.com/SteveL-MSFT
https://github.com/mklement0
Michael Klement (mklement0)https://github.com/mklement0
on Feb 1, 2020https://github.com/PowerShell/PowerShell/issues/11719#issuecomment-581075598
https://github.com/iSazonov
Ilya (iSazonov)https://github.com/iSazonov
on Feb 2, 2020https://github.com/PowerShell/PowerShell/issues/11719#issuecomment-581110922
Michael Klement (@mklement0)https://github.com/mklement0
https://github.com/scotthardwick
Scott Hardwick (scotthardwick)https://github.com/scotthardwick
on Feb 2, 2020https://github.com/PowerShell/PowerShell/issues/11719#issuecomment-581143128
Michael Klement (@mklement0)https://github.com/mklement0
https://github.com/SteveL-MSFT
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
on Feb 6, 2020https://github.com/PowerShell/PowerShell/issues/11719#issuecomment-583023699
Michael Klement (@mklement0)https://github.com/mklement0
Steve Lee (SteveL-MSFT)https://github.com/SteveL-MSFT
Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Up-for-Grabs%22
on Feb 6, 2020https://github.com/PowerShell/PowerShell/issues/11719#event-3014845802
https://github.com/jackdcasey
Jack Casey (jackdcasey)https://github.com/jackdcasey
on Mar 23, 2020https://github.com/PowerShell/PowerShell/issues/11719#issuecomment-602432171
Travis Plunk (TravisEz13)https://github.com/TravisEz13
completedhttps://github.com/PowerShell/PowerShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#12179https://github.com/PowerShell/PowerShell/pull/12179
on Apr 7, 2020https://github.com/PowerShell/PowerShell/issues/11719#event-3211490606
Ilya (iSazonov)https://github.com/iSazonov
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
Up-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Up-for-Grabs%22
on Apr 8, 2020https://github.com/PowerShell/PowerShell/issues/11719#event-3212377206
Ryan Yates (kilasuit)https://github.com/kilasuit
WG-Cmdletsgeneral cmdlet issueshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Cmdlets%22
WG-Cmdlets-Utilityhttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Cmdlets-Utility%22
on Jul 17, 2026https://github.com/PowerShell/PowerShell/issues/11719#event-28140137285
Sign up for freehttps://github.com/signup?return_to=https://github.com/PowerShell/PowerShell/issues/11719
Sign in to commenthttps://github.com/login?return_to=https://github.com/PowerShell/PowerShell/issues/11719
Issue-Enhancementthe issue is more of a feature request than a bughttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Issue-Enhancement%22
Resolution-FixedThe issue is fixed.https://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22Resolution-Fixed%22
WG-Cmdletsgeneral cmdlet issueshttps://github.com/PowerShell/PowerShell/issues?q=state%3Aopen%20label%3A%22WG-Cmdlets%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.