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

FLIP 251: Cadence Date and Time #245

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

darkdrag00nv2
Copy link
Contributor

@darkdrag00nv2 darkdrag00nv2 commented Jan 29, 2024

#251

Work towards onflow/cadence#843

@darkdrag00nv2 darkdrag00nv2 changed the title FLIP 245: Cadence Date and time FLIP 245: Cadence Date and Time Jan 29, 2024
@darkdrag00nv2 darkdrag00nv2 marked this pull request as ready for review February 4, 2024 13:33
@darkdrag00nv2
Copy link
Contributor Author

cc: @turbolent @SupunS @dsainati1

@bluesign
Copy link
Collaborator

It is assumed that there are 3600*24 seconds in every day and there are no leap years.

I think ignoring leap years is not a good idea.

@turbolent
Copy link
Member

turbolent commented Feb 19, 2024

It is assumed that there are 3600*24 seconds in every day and there are no leap years.

I think ignoring leap years is not a good idea.

Agreed, we can probably at least support leap years, like e.g. Java's java.time.LocalDate does.

In general, we should not reinvent the wheel here and base the API and implementation of an established solution, like e.g. Java's JSR310

@darkdrag00nv2
Copy link
Contributor Author

In general, we should not reinvent the wheel here and base the API and implementation of an established solution, like e.g. Java's JSR310

Yep, the current proposal is more based on the python datetime module.

I wrongly made the assumption that they don't support leap years 🙁. I was just giving the wrong input with the year 2011 🤦

>>> datetime.datetime(2011, 2, 29)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: day is out of range for month

Trying with an actual leap year works fine.

>>> datetime.datetime(2024, 2, 29)

@KshitijChaudhary666
Copy link
Contributor

Hi @darkdrag00nv2 - this FLIP is not reflected on FLIP project tracker. Did you follow the process outlined in https://github.com/onflow/flips? Specifically please remember to do the following without which the FLIP won't get visibility on the project tracker-

Create an issue by using one of the FLIP issue templates based on the type of the FLIP - application, governance, cadence or protocol. The title of the issue should be the title of your FLIP, e.g., "Dynamic Inclusion fees". Submit the issue. Note the issue number that gets assigned.
Then, create your FLIP as a pull request to this repository (onflow/flips). Use the issue number generated in step 2 as the FLIP number. And mention the FLIP issue by copying the GitHub URL or the issue in the comment section.

Thank you!

@darkdrag00nv2 darkdrag00nv2 changed the title FLIP 245: Cadence Date and Time FLIP 251: Cadence Date and Time Mar 3, 2024
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.

None yet

4 participants