CS50 Time Converter

CS50 Time Converter is a web app at time.cs50.io that converts (dates and) times to users’ own time zones, as might be helpful for deadlines and events for teachers and students in different time zones. Its landing page supports manual input in numerous formats, and its API allows for links to specific (dates and) times. It guesses a user’s time zone on a user’s first visit but allows for manual override, remembering a user’s selection thereafter.

Formats

CS50 Time Converter’s landing page supports inputs in over 200 language locales plus numerous formats, among them:

  • Wednesday, December 31, 1969, 7:00 PM EST

  • Wed, 31 Dec 1969 19:00:00 EST

  • Wed, 31 Dec 1969 19:00:00 -0500

  • Dec 31, 1969 7:00 PM in Eastern Time (US and Canada)

  • Dec 31, 1969 7:00 PM Eastern Time (US and Canada)

  • 1969-12-31 19:00

  • 19691231T190000-0500

  • 1969-12-31T19:00:00-05:00

  • tomorrow at 1:37 PM

  • tomorrow at 1:37pm

  • tomorrow at 13:37

  • tuesday at noon

  • tue at noon

  • 19700101T000000Z

  • 19700101T000000+0000

  • 1970-01-01T00:00:00Z

  • 1970-01-01T00:00:00+00:00

  • Thu, 01 Jan 1970 00:00:00 +0000

  • Thu, 01 Jan 1970 00:00:00 GMT

API

Paths

CS50 Time Converter supports URLs of the forms

  • https://time.cs50.io/:start

  • https://time.cs50.io/:start/:end

  • https://time.cs50.io/:start/:duration

  • https://time.cs50.io/:duration/:end

where each of :start and :end is a combined date and time in ISO 8601 format, and :duration is a duration in ISO 8601 format. It is not necessary to encode any + therein as %2B.

A deadline or an event with no end time might thus use the form https://time.cs50.io/:start.

For instance, all of the below represent Tue, 19 Jan 2038 03:14:07 +0000, using UTC:

And all of the below represent the same, Mon, 18 Jan 2038 10:14:07 -0500, using Eastern Standard Time:

An event with an end time might use any of https://time.cs50.io/:start/:end, https://time.cs50.io/:start/:duration, and https://time.cs50.io/:duration/:end.

For instance, all of the below represent an interval from Thu, 01 Jan 1970 00:00:00 +0000 until Tue, 19 Jan 2038 03:14:07 +0000:

Times converted via CS50 Time Converter’s landing page standardize on the shortest of these forms, omitting hyphens (-) and colons (:).

Combined dates and times without an offset are assumed to be in America/New_York.

Queries

CS50 Time Converter also supports URLs of the forms

  • https://time.cs50.io/?start=START

  • https://time.cs50.io/?start=START&zone=ZONE

  • https://time.cs50.io/?start=START&end=END

  • https://time.cs50.io/?start=START&end=END&zone=ZONE

where START and END are in any of the formats supported by CS50 Time Converter’s landing page, and ZONE is any of the time zones supported by the same. Each of START and END will be assumed to be in ZONE unless a time zone or offset is specified in START or END itself. Values of START and END without a specified time zone or offset are assumed to be in America/New_York if no ZONE is provided.