Algolisted-Org / AlgoListed

Algolisted is an AI-powered nonprofit analytics firm dedicated to assisting computer science students in preparing for placements and internships. Our services include tracking and analytics across various platforms and topics.
http://algolisted.com
Other
135 stars 75 forks source link

add UTC representation( IST ) for local time of india #73

Closed dineshigdd closed 1 year ago

dineshigdd commented 1 year ago

I added a new function named getIST() which returns the UTC representation of local Indian time. I also change the timeLeft component in TimeLeft.js to represent the local Indian time as UTC time.

for example, Jan 12 2023 8:30:00 GMT+0530 UTC is the UTC/GMT representation of the local Indian time "Jan 12, 2023" in API. Minutes are also added.

Initially, tried to change every date and time into milliseconds and then to UTC time. However, this approach results in an error in the output. Therefore, the getIST() function converts a string representation of UTC to Date and returns this Date.

I tested with online tools such as https://www.timeanddate.com/date/timeduration.html to check the time left. It looks to me output in the table matches the output given by this tool. If there is any difference it is in a few minutes( 1 or 2-minute difference )

I also use this tool https://www.freeconvert.com/time/ist-to-utc

NayakPenguin commented 1 year ago

@dineshigdd, your work on this code is excellent. It is very clean and functions perfectly. I have thoroughly reviewed it and do not believe there are any edge cases that have been overlooked. Additionally, the description of your work demonstrates your professionalism. Great job!

dineshigdd commented 1 year ago

Thank you. Happy to help you