Timezone Not Local
![Abdullah Abdulkarim](https://us.v-cdn.net/6037124/user_avatars/96.jpg)
Hi, I have a function with 2 inputs:
{ "date_input": "now",
"timezone_input": "America/New_York" }
I'm trying to get the date for users in New York. However, when I run my function it keeps giving me the date for UTC rather than the local date.
Not sure what i'm missing, I included screenshots below, it's Nov 21st New York time, but it keeps giving me Nov 22nd.
Best Answer
-
Hi @Abdullah Abdulkarim -- timestamps and dates are two different data types. You will either want to use a timestamp input to apply this transformation or convert your date input into a UNIX timestamp in milliseconds before applying the transformation
Answers
-
When you pass the "now", it do not take any timezone consideration.
You eventually said to convert the date(with no timezone) to "America/new york", that's why it return an error in the date.
You also want to add "h:m" into the formatted date so that you can actually show the timezone differences in date.
-
@Michael Udinski thanks, that fixed it! I switched to a timestamp and the rest worked
-
@Michael Udinski Hi, I hope you are very well, first of all, I am sorry for using this space to publish this, which is not related, I wanted to tell you michael that I made a post about 5 days ago and it is still not published and of course I have not been able to get an answer. what should I do?
(it says that once it is verified it will be published, but that was several days ago, I tried to do it again and the same thing happened).
-
@NelsonOrlando12 message me. Will see if I can help you.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback