{"id":19044805,"url":"https://github.com/salvillalon45/timestamp-freecodecamp","last_synced_at":"2026-04-07T21:31:39.912Z","repository":{"id":212208800,"uuid":"725763620","full_name":"salvillalon45/timestamp-freeCodeCamp","owner":"salvillalon45","description":"A REST API to give you the current date or any date you give it in unix and utc format! ","archived":false,"fork":false,"pushed_at":"2023-12-20T20:56:49.000Z","size":8249,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-21T23:31:33.552Z","etag":null,"topics":["expressjs","javascript","momentjs","nodejs","render","rest-api","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/salvillalon45.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-30T20:31:52.000Z","updated_at":"2024-02-01T19:33:44.000Z","dependencies_parsed_at":"2023-12-20T11:44:48.942Z","dependency_job_id":"8658edb9-43e6-4392-8464-42c06a4edf43","html_url":"https://github.com/salvillalon45/timestamp-freeCodeCamp","commit_stats":null,"previous_names":["salvillalon45/freecodecamp-timestamp","salvillalon45/timestamp-freecodecamp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/salvillalon45/timestamp-freeCodeCamp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2Ftimestamp-freeCodeCamp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2Ftimestamp-freeCodeCamp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2Ftimestamp-freeCodeCamp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2Ftimestamp-freeCodeCamp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/salvillalon45","download_url":"https://codeload.github.com/salvillalon45/timestamp-freeCodeCamp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/salvillalon45%2Ftimestamp-freeCodeCamp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279019062,"owners_count":26086516,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-14T02:00:06.444Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["expressjs","javascript","momentjs","nodejs","render","rest-api","typescript"],"created_at":"2024-11-08T22:47:30.850Z","updated_at":"2025-10-14T11:36:09.947Z","avatar_url":"https://github.com/salvillalon45.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Timestamp\n\nfreeCodeCamp - Back End Development and APIs | Project: Timestamp\n\n# Summary\n\nCreate a timestamp api that will take in route params. A request to /api/:date? with a valid date should return a JSON object with a unix key that is a Unix timestamp of the input date in milliseconds (as type Number) and a utc key that is a string of the input date in the format: Thu, 01 Jan 1970 00:00:00 GMT.\n**[Learn more about the Project Task.](https://www.freecodecamp.org/learn/back-end-development-and-apis/back-end-development-and-apis-projects/timestamp-microservice)**\n\nThe route params are the following:\n\n-   A unix timestamp like 1451001600000\n-   A string such as 2015-12-25 or 05 October 2011, GMT\n-   The route params can also be invalid date inputs such as a string like this this-is-not-a-date\n-   An empty route parameter should return the current time and date in a JSON object with a unix and utc key\n\nExamples:\n- http://localhost:3000/api/2015-12-25\n- http://localhost:3000/api/1451001600000\n- http://localhost:3000/api/05 October 2011, GMT\n- http://localhost:3000/api/this-is-not-a-date\n- http://localhost:3000/api/\n\n### Implementation\n\n-   Use momentjs isValid function to check if the dateInput is a valid date\n-   Created a TypeScript + Express API\n-   Used `Map` to easily create objects and convert the `Map` into an object\n-   Created a ` util.ts`` file to place all the helper functions used in the  `server.ts` file\n-   Used [Date.getTime()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime) to return the number of milliseconds for this date since the epoch\n-   Used [Date.toUTCString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toUTCString) to return a string representing this date in the RFC 7231 format, with negative years allowed\n\n### Demo\n\n\u003cimg alt=\"Timestamp Demo\" src=\"./timestamp_demo.gif\" width=\"600\" /\u003e\n\n# Technologies:\n\n-   JavaScript\n-   TypeScript\n-   Render\n-   momentjs\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalvillalon45%2Ftimestamp-freecodecamp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsalvillalon45%2Ftimestamp-freecodecamp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsalvillalon45%2Ftimestamp-freecodecamp/lists"}