Skip to content

Latest commit

History

79 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Convert Date Time Zone

A simple Date Time conversion repo

Build Status

This is a simple repo to convert your dateTime with your specified timeZone. This code supports only UTC to GMT conversion, GMT to UTC conversion. You can also get the current date and time with the specific timezone.

Features

  • Get current dateTime in ISO format in UTC or GMT.
  • Convert dateTime from GMT to UTC and vice-versa.

Usage

This git repo is hosted on heroku:

Callout method supported - GET

Examples

1. Convert Date from UTC to GMT

ParamDescriptionRequired
dateTimeISO formatted date to convert into GMTYes
convertToGMT timezone nameYes

Correct Reponse

{
"success": true,
"date": "2021-05-15",
"time": "5:47 pm",
"dateTime": "2021-05-15T17:47:08.213Z"
}

Incorrect Reponse

{
"success": false,
"message": "Required field missing or Date not in proper ISO format."
}

2. Convert Date from GMT to UTC

ParamDescriptionRequired
dateTimeISO formatted date to convert into GMTYes
convertFromGMT timezone nameYes
convertToUTCOptional (Default UTC)

Correct Reponse

{
"success": true,
"date": "2021-05-15",
"time": "11:51 am",
"dateTime": "2021-05-15T11:51:30.000Z"
}

Incorrect Reponse

{
"success": false,
"message": "Required field missing or Date not in proper ISO format."
}

3. Get Current Date Time in ISO Format

ParamDescriptionRequired
convertToUTC or any GMT timezoneOptional (Default UTC)

Correct Reponse

{
"success": true,
"date": "2021-05-15",
"time": "6:06 pm",
"dateTime": "2021-05-15T18:06:24.322Z"
}

Incorrect Reponse

{
"success": false,
"message": "Required field missing or Date not in proper ISO format."
}

Params for Response

ParamDescription
successFlag to show the response status of the callout
dateIn YYYY-MM-DD format
timeIn AM/PM format
dateTimeIn ISO format
messageonly when error occurs during callout

Development

This code is written on node js. Hosted on Heroku.

Build by

Nishank Gupta

Free API, Enjoy CODING!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages