Skip to content

Add date/time conversion logic - #1

Open
dBozee wants to merge 5 commits into
hencaric:mainfrom
dBozee:dt-conversion
Open

Add date/time conversion logic#1
dBozee wants to merge 5 commits into
hencaric:mainfrom
dBozee:dt-conversion

Conversation

@dBozee

@dBozee dBozee commented Nov 19, 2025

Copy link
Copy Markdown

This PR adds a new cog to convert many common formats of datetime strings to a discord epoch timestamp.

Usage / Testing:

This should be able to work by using the new &convert command. This should allow for space delimited strings, such as:

  • "Nov 11, 2025 at 16:00 UTC" "Nov 11, 2025 at 16:00".
    • Note the second timestamp here has no UTC. This should still auto evaluate to a UTC datetime object and then be converted.
  • 2025-11-19T02:05:26Z
  • November 11 2025 at 4PM
    etc.

Command usage:

&convert <format> <timestamp>
Below are the formats with examples
image

Any failed attempts should be logged to the server log, however, this could be refactored to return in the message as well if wanted.

Side note: If we were to migrate this to allowing for slash commands, it would give unlimited boxes to continue filling, which would get away from needing to wrap strings in double quotes.

@dBozee dBozee changed the title Add DT conversion logic Add date/time conversion logic Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant