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 ability to create datetimes in the future using timestamps #7170

Open
boyney123 opened this issue Sep 25, 2024 · 1 comment
Open

Add ability to create datetimes in the future using timestamps #7170

boyney123 opened this issue Sep 25, 2024 · 1 comment
Labels
✨ enhancement New feature or request 🎨 sdk SDK

Comments

@boyney123
Copy link
Contributor

Use Case

I'm trying to set an expiry date (TTL) on a dynamodb field, and want to say the current date + 3 minutes in the future.

With Wing I believe there is no easy way to do this? My suggestion after speaking with @Chriscbr is maybe we can add a utility on the datetime.

Proposed Solution

Add fromTimestamp function onto the datetime.

let original = datetime.utcNow();
let later = datetime.fromTimestamp(original.timestamp + 5 * 60); (5 minutes in the future)

Implementation Notes

No response

Component

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
  • If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out on the #dev channel in the Wing Discord.
@boyney123 boyney123 added ✨ enhancement New feature or request needs-discussion Further discussion is needed prior to impl labels Sep 25, 2024
@monadabot monadabot added this to Wing Sep 25, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New - not properly defined in Wing Sep 25, 2024
@Chriscbr
Copy link
Contributor

Related: #7149

@Chriscbr Chriscbr added 🎨 sdk SDK and removed needs-discussion Further discussion is needed prior to impl labels Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request 🎨 sdk SDK
Projects
Status: 🆕 New - not properly defined
Development

No branches or pull requests

2 participants