-
Notifications
You must be signed in to change notification settings - Fork 1.6k
isoTimestamp returns some random timestamp #4631
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
Comments
Can confirm the same behaviour. Maybe the documentation is wrong and a random timestamp is meant? |
I don't think it's a documentation bug, postman uses the same variable: https://learning.postman.com/docs/tests-and-scripts/write-scripts/variables-list/. Also, there are 3 other variables ({{$randomDate*}}) for random timestamps. |
Currently we are using random time to generate this
see https://github.com/usebruno/bruno/blob/main/packages/bruno-common/src/utils/faker-functions.ts |
@sww-jm
You then can use {{currentTimestamp}} in your requests. If you add the following lines to the Pre Request script you can see the difference to {{$timestamp}} in the Developer Tools console:
|
ah, very nice! (and dividing by 1000 to get the timestamp in seconds totally makes sense) maybe you could add a new variable "timestamp_ms" which contains the timestamp in milliseconds? |
I have checked the following:
This bug is:
Bruno version
2.2.0
Operating System
Linux, Ubuntu 24
Describe the bug
Simply put {{$isoTimestamp}} as one of the request body parameters.
Expected: should be converted into current timestamp
Actual: some random timestamp from past or the future
.bru file to reproduce the bug
No response
Screenshots/Live demo link
The text was updated successfully, but these errors were encountered: