Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add weekday() and current_time() functions #71

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

EduardoRSeifert
Copy link
Member

Description ✍️

This PR adds 2 new functions to parsec, weekday and current_time.

weekday()

weekday will calculate the weekday based on a date or datetime, and will return an integer if no locale is passed or a string with the translated weekday name if a locale is passed

current_time()

current_time will return the current_time in gmt. If the (optional) integer argument is passed, it'll return the current_time considering the argument as an offset.

Examples

'weekday("2024-12-05")' will return 4, and 'weekday("2021-03-21", "pt-BR")' will return 'Quinta-Feira'

At the time of writing:
current_time() will return 19:09:13 and current_time(-3) 16:09:13 (GMT -3 is brasil time)

Overview 🔍

Overview of the feature if possible (screenshot, gif, etc)

Checks ☑️

  • Example

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