Ad

How To Add Time To Schema Event Type

- 1 answer

My startDate looks like this 03-03-2020 but I need to add time as well. I have checked some example schema from other sources and have come across something similar:

2020-03-03T12:45:00+01:00

I have two concerns: Does the time format matter? My format is dd-mm-YYYY. The second example format is different. Is there any problem having it either way?

How do you properly add the time time to the startDate property. Is the last extension the TimeZone e.g +03:00 or should you use the Universal Time zone then include your Timezone (Time offset).

Please help clarify.

Ad

Answer

I have two concerns: Does the time format matter? My format is dd-mm-YYYY. The second example format is different. Is there any problem having it either way?

If you check the description of the startDate property then there you will see the following information:

The start date and time of the item (in ISO 8601 date format).

If you follow the specified link, then in the Wikipedia article (in the right panel) you can see the following time format:

Date 2020-03-04

In order to establish a machine-readable format, you can use an HTML element such as time with datetime.

======================================

How do you properly add the time time to the startDate property. Is the last extension the TimeZone e.g +03:00 or should you use the Universal Time zone then include your Timezone (Time offset).

Indicate time in ISO format with a time offset, e.g., if you are located in the Canadian province of Yukon then you can use a time zone indication such as 2020-03-04T05:16:15-08:00. In Sweden, I have Central European Time with a time offset of +1 hour and summertime +2 hours. So at the moment in Sweden, I can use a time format such as 2020-03-04T05:22:16+01:00. However, the Sweden summertime will be in a format such as 2020-07-04T05:22:16+02:00

Ad
source: stackoverflow.com
Ad