JSON time offset (Trello) - json

I'd like to create Trello cards over the Trello API. I'am able to create a card with:
curl -X POST 'https://api.trello.com/1/lists/{LIST_ID}/cards?name=TEST9&due=2014-05-08T08:00:00&key={APP_KEY}&token={TOKEN}'
However, I can't determine my time offset for the due date:
2014-05-08T08:00:00.{OFFSET}
My Timezone is CET (Europe/Berlin), how can I tell Trello this with the time offset?

I could not find it in the documentation, but I am quite sure Trello stores the due dates in UTC. So as the comment already suggests, convert your timestamp to their timezone (which would be UTC).

Related

Weird date format from mysql in vuejs

Time in mysql is stored like this
2022-04-25 11:03:20
but when it is showed on client with vuejs i am getting this as response
2022-04-25T09:03:20.000Z
How do i show it as it is shown in db?
The date you're getting is in ISO-8601 format. You'll want to continue to store it like that so you've got the timezone (as denoted by the suffix 'Z'). In your frontend, it's easy to convert the date into any format you like.
For example, based on your example, you can use:
const dateFromDb = '2022-04-25T09:03:20.000Z';
const dateForUi = new Date(dateFromDb).toLocaleString('nl-NL');
console.log(dateForUi); // 25-4-2022 10:03:20
You can also convert any date object back into ISO format, using .toISOString().
There's also many other date formatting methods (outlined in the Date() docs), or for more advanced date / time operations there are libraries like moment.js

How to save Timestamp in Firebase in Appsmith app or using JSON?

I am trying to save the date/time in Firebase in timestamp format. I have referred answers from below posts.
How to get current timestamp of firebase server in milliseconds?
https://www.reddit.com/r/Firebase/comments/n32ys2/how_can_i_save_the_values_in_the_datepicker_as/
I have tried saving data by adding different date formats in Body but it is ultimately getting added as a string or number depending upon string or timestamp.
Does anyone have idea how to send the date to Firestore using JSON or anything using which i can directly add it to Appsmith app?
As of now Appsmith supports adding a server timestamp to any field in Firestore. Server timestamp is the timestamp provided by the Firestore server when that particular query was executed.
e.g. if there is entry like
{
id : {name: foo, lastUpdated: ts}
}
then the lastUpdated field could be updated with the last update timestamp via setting the Timestamp Value Path to ["id.lastUpdated"]
Please checkout the video here and comment by user tazmaniax to understand more: https://github.com/appsmithorg/appsmith/pull/3693
Reference:
https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/FieldValue#serverTimestamp()
Appsmith's documentation for this is under progress and will be available on the Appsmith documentation site soon. Apologies for not putting it over there sooner.
For any other query or help please join Appsmith's discord channel
I have the impression that there is an error with the Firestore and Appsmith connector.
I have tried different combinations and if you do not send a string, int or bool in the json request, errors are generated.
However Appsmith added an additional field for handling timestamp (now)

Why is Time not setting when inserting new task using Task Service?

I am trying to insert new task with due date and time in Google Tasks using Tasks Service. The issue i am facing is that date is setting correctly while time is not setting. The code is given below:
I had tried all the solutions given on stackoverflow and other platform, none of them worked.
var task = Tasks.newTask().setTitle(data[i]);
task.setDue("2019-6-25T10:10:10.000Z");
Tasks.Tasks.insert(task, taskList.id);
I expect both the date and time to be set but only date is setting.
The official document says as follows.
Due date of the task (as a RFC 3339 timestamp). Optional. The due date only records date information; the time portion of the timestamp is discarded when setting the due date. It isn't possible to read or write the time that a task is due via the API.
Unfortunately, in the current stage, by above specification, even if 2019-6-25T10:10:10.000Z is used for due, it becomes 2019-06-25T00:00:00.000Z. So it seems that in order to modify the time, it is required to manually modify it.
Reference:
Resource representations of Tasks

Weather from yesterday

I would like to get everyday of the weather from yesterday with darksky, but how do I set this up? Because the UnixTime is based on date, but the only thing I would like is the following data from yesterday, not hourly, daily is just fine:
Is use this from the API:
GET https://api.darksky.net/forecast/{key}/52.1038,5.1909?exclude=currently,flags,hourly&lang=nl&units=auto
Here you can read the documentation:
https://darksky.net/dev/docs/time-machine
{
"time":1502575200,
"summary":"Licht bewolkt vanaf de middag, houdt aan tot de avond.",
"icon":"partly-cloudy-day",
"sunriseTime":1502598072,
"sunsetTime":1502651386,
"moonPhase":0.69,
"precipIntensity":0.0178,
"precipIntensityMax":0.1245,
"precipIntensityMaxTime":1502618400,
"precipProbability":0.13,
"precipType":"rain",
"temperatureMin":13.25,
"temperatureMinTime":1502596800,
"temperatureMax":21.37,
"temperatureMaxTime":1502640000,
"apparentTemperatureMin":13.25,
"apparentTemperatureMinTime":1502596800,
"apparentTemperatureMax":21.37,
"apparentTemperatureMaxTime":1502640000,
"dewPoint":12.9,
"humidity":0.76,
"windSpeed":0.47,
"windGust":4.88,
"windGustTime":1502658000,
"windBearing":12,
"cloudCover":0.27,
"pressure":1019.62,
"ozone":303.52,
"uvIndex":4,
"uvIndexTime":1502618400
}
From their documentation for request parameters:
Either be a UNIX time (that is, seconds since midnight GMT on 1 Jan 1970) or a string formatted as follows: [YYYY]-[MM]-[DD]T[HH]:[MM]:[SS][timezone].
The easiest way would be to subtract 86400 (the number of seconds in a day) from the current UNIX timestamp. This will give you yesterday's UNIX timestamp.
The API sends through daily information in the response. https://darksky.net/dev/docs/response You can get this data using any time value on a given day.
Days are 86400 second long and so subtracting or adding multiples of this number will allow you to change the date.
The API also allows a string formatted as [YYYY]-[MM]-[DD]T[HH]:[MM]:[SS][timezone]. You could use this format instead for readability if it is easier.

Inconsistent time difference in facebook post graph API

Recently, i'm making an application which retrieve facebook posts of a page for a certain date. The issue that i've encountered is, there are some inconsistencies between the post unix time and the displayed date for some posts.
This is an example that i've found:
Created time from JSON reponse : "created_time": "2013-03-09T18:58:20+0000"
Displayed date :March 10, 2013 at 1:58am
The time difference is : 1:58 am - 18: 58 pm = 7 hr
then, for another post:
Created time from JSON reponse : "created_time": "2013-03-09T19:03:17+0000"
Displayed date :March 10, 2013 at 3:03am
The time difference is : 3:03 am - 19: 03 pm = 8 hr
And no, I didn't change my timezone inbetween displaying those two JSON response.
I use graph API and 'since until' parameter with unix timestamp for getting the JSON response.
Is there anyone who can explain this issue?
Thanks in advance! :)
After much more time spending on it..i found this helpful link to implement in my project...
i hope it may helpful to u also..
How to convert Date from facebook api into android app date format