{"id":27629272,"url":"https://github.com/diecknet/guidv7","last_synced_at":"2025-07-17T07:06:34.190Z","repository":{"id":289266571,"uuid":"970041218","full_name":"diecknet/GUIDv7","owner":"diecknet","description":"GUIDv7 in PowerShell","archived":false,"fork":false,"pushed_at":"2025-04-22T11:25:56.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T15:15:54.746Z","etag":null,"topics":["guid","guidv7","powershell","powershell-module","uuid","uuid-v7","uuidv7"],"latest_commit_sha":null,"homepage":"https://www.powershellgallery.com/packages/GUIDv7/","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/diecknet.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-21T11:13:23.000Z","updated_at":"2025-04-22T14:06:14.000Z","dependencies_parsed_at":"2025-04-23T15:15:54.610Z","dependency_job_id":null,"html_url":"https://github.com/diecknet/GUIDv7","commit_stats":null,"previous_names":["diecknet/guidv7"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/diecknet/GUIDv7","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diecknet%2FGUIDv7","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diecknet%2FGUIDv7/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diecknet%2FGUIDv7/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diecknet%2FGUIDv7/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/diecknet","download_url":"https://codeload.github.com/diecknet/GUIDv7/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/diecknet%2FGUIDv7/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265575505,"owners_count":23790780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["guid","guidv7","powershell","powershell-module","uuid","uuid-v7","uuidv7"],"created_at":"2025-04-23T15:15:53.171Z","updated_at":"2025-07-17T07:06:34.185Z","avatar_url":"https://github.com/diecknet.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PowerShell module GUIDv7\n\nThis module helps interacting with v7 GUIDs (see [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-7)).  \nIt requires .NET 9.0 or later (which PowerShell 7.5 or later is based on).\n\n## Install\n\nThe module is [available from the PowerShell Gallery](https://www.powershellgallery.com/packages/GUIDv7).\n\n```powershell\nInstall-PSResource GUIDv7\n```\n\n## Demo / Videos\n\nThere is a longer German Video here: \u003chttps://youtu.be/mE4cZlL_4Xc\u003e  \nAnd a shorter English Video here: \u003chttps://www.youtube.com/shorts/9E6xtKzKy0I\u003e (⚠️ Vertical Video Warning ⚠️)\n\n## Usage examples\n\n### Example 1: Generate a GUIDv7 based on the current date/time\n\n```powershell\nNew-GUIDv7\n```\n\n```output\nGuid\n----\n01965890-1915-7d89-96f5-b660ee72e5fa\n```\n\n### Example 2: Generate a GUIDv7 based on a specific date/time\n\n```powershell\nNew-GUIDv7 -DateTimeOffset (Get-Date \"2023-10-01 00:00:00\")\n```\n\n```output\nGuid\n----\n018ae81b-0700-7e66-b050-3a166600f7c4\n```\n\n### Example 3: Generate a GUIDv7 by piping a date to the cmdlet\n\n```powershell\nGet-Date \"2024-06-06 15:00:00\" | New-GUIDv7\n```\n\n```output\nGuid\n----\n018feda2-7c80-7d40-8dee-ccb2974db838\n```\n\n### Example 4: Get the `[DateTimeOffset]` from a GUIDv7\n\n```powershell\n$GUID = \"01965893-c0aa-722e-8dd0-151b5bba56e3\"\nGet-DateTimeOffsetFromGUIDv7 -GUID $GUID\n```\n\n```output\nDateTime           : 21/04/2025 13:40:00\nUtcDateTime        : 21/04/2025 13:40:00\nLocalDateTime      : 21/04/2025 15:40:00\nDate               : 21/04/2025 00:00:00\nDay                : 21\nDayOfWeek          : Monday\nDayOfYear          : 111\nHour               : 13\nMillisecond        : 298\nMicrosecond        : 0\nNanosecond         : 0\nMinute             : 40\nMonth              : 4\nOffset             : 00:00:00\nTotalOffsetMinutes : 0\nSecond             : 0\nTicks              : 638808396002980000\nUtcTicks           : 638808396002980000\nTimeOfDay          : 13:40:00.2980000\nYear               : 2025\n```\n\n### Example 5: Get the local time from a GUIDv7\n\n```powershell\n$GUID = \"01965893-c0aa-722e-8dd0-151b5bba56e3\"\n(Get-DateTimeOffsetFromGUIDv7 -GUID $GUID).LocalDateTime\n```\n\n```output\n# depends on the localization. but for example:\nMonday, 21 April 2025 15:40:00\n```\n\n### Example 6: Demonstrate that GUIDv7 are sortable by date\n\n```powershell\n$GUIDTest = for($i = 0; $i -lt 10; $i++) {\n    New-GUIDv7 -DateTimeOffset ((Get-Date).AddDays((Get-Random -Minimum -10000 -Maximum 10000)).AddSeconds((Get-Random -Minimum -10000 -Maximum 10000)))\n}\nforeach($GUID in ($GUIDTest | Sort-Object)) {\n    $DateTimeOffset = Get-DateTimeOffsetFromGUIDv7 -GUID $GUID\n    if ($null -eq $DateTimeOffset) {\n        Write-Host \"Failed to get DateTimeOffset from GUIDv7: $GUID\"\n    } else {\n        Write-Host \"$GUID = $($DateTimeOffset.LocalDateTime)\"\n    }\n}\n```\n\n```output\n00e6edbf-334f-7da0-a038-3bafbf4e653d = 06/06/2001 14:40:08\n0108ba7b-e88f-7e8a-84be-d457be0fcd7c = 01/11/2006 18:20:48\n01234257-f528-76eb-8fb3-f6d2c37a63d8 = 08/22/2009 15:42:23\n0124818f-ce65-7565-a038-c92b61e9cbe3 = 10/23/2009 15:22:15\n01666d81-75b0-77d6-9d90-5a960e8054ee = 10/13/2018 14:58:12\n017425d7-8687-7ad2-95a7-7e2f046e72cd = 08/25/2020 15:38:35\n01e774b6-3e98-7d88-bf6f-27d441aa8f1c = 05/05/2036 15:32:53\n020b7203-f517-7b30-a115-2a69a8266acc = 03/29/2041 15:39:17\n02172c45-f5d7-7e63-8965-84b39fe6192a = 11/02/2042 15:11:25\n022eba98-51e7-78de-a684-0f243b02c54d = 01/16/2046 14:31:35\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiecknet%2Fguidv7","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiecknet%2Fguidv7","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiecknet%2Fguidv7/lists"}