{"id":18614824,"url":"https://github.com/andrewjbateman/timestampunix","last_synced_at":"2026-04-12T05:33:48.332Z","repository":{"id":96860975,"uuid":"133340385","full_name":"AndrewJBateman/TimestampUNIX","owner":"AndrewJBateman","description":":clipboard: Gives the UNIX-time generated from a user date input","archived":false,"fork":false,"pushed_at":"2024-03-28T00:28:16.000Z","size":469,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-17T01:34:29.569Z","etag":null,"topics":["express","glitch","heroku","javascript","json","node","nodejs","npm","npm-module"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/AndrewJBateman.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":"2018-05-14T09:54:21.000Z","updated_at":"2022-04-12T10:11:25.000Z","dependencies_parsed_at":"2024-11-07T03:34:05.922Z","dependency_job_id":"dc202a1d-647d-4798-a528-22d0b68305cf","html_url":"https://github.com/AndrewJBateman/TimestampUNIX","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AndrewJBateman/TimestampUNIX","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2FTimestampUNIX","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2FTimestampUNIX/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2FTimestampUNIX/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2FTimestampUNIX/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AndrewJBateman","download_url":"https://codeload.github.com/AndrewJBateman/TimestampUNIX/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AndrewJBateman%2FTimestampUNIX/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31705574,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-12T05:11:36.334Z","status":"ssl_error","status_checked_at":"2026-04-12T05:11:27.332Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["express","glitch","heroku","javascript","json","node","nodejs","npm","npm-module"],"created_at":"2024-11-07T03:27:08.156Z","updated_at":"2026-04-12T05:33:48.313Z","avatar_url":"https://github.com/AndrewJBateman.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :zap: Timestamp Microservice for FCC\n\n* Returns UNIX and UTC timestamps for date inputs or current date/time\n* This was part of the FreeCodeCamp exercises for Front End Certification\n* **Note:** to open web links in a new window use: _ctrl+click on link_\n\n![GitHub repo size](https://img.shields.io/github/repo-size/AndrewJBateman/TimestampUNIX?style=plastic)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/AndrewJBateman/TimestampUNIX?style=plastic)\n![GitHub Repo stars](https://img.shields.io/github/stars/AndrewJBateman/TimestampUNIX?style=plastic)\n![GitHub last commit](https://img.shields.io/github/last-commit/AndrewJBateman/TimestampUNIX?style=plastic)\n\n## :page_facing_up: Table of contents\n\n* [:zap: Timestamp Microservice for FCC](#zap-timestamp-microservice-for-fcc)\n  * [:page_facing_up: Table of contents](#page_facing_up-table-of-contents)\n  * [:books: General info](#books-general-info)\n  * [:camera: Screenshots](#camera-screenshots)\n  * [:signal_strength: Technologies](#signal_strength-technologies)\n  * [:floppy_disk: Setup](#floppy_disk-setup)\n  * [:computer: Code Examples](#computer-code-examples)\n  * [:cool: Features](#cool-features)\n  * [:clipboard: Status \u0026 To-Do List](#clipboard-status--to-do-list)\n  * [:clap: Inspiration](#clap-inspiration)\n  * [:envelope: Contact](#envelope-contact)\n\n## :books: General info\n\n* Original instructions (User Stories) from FCC:\n\n1. The API endpoint is `GET [project_url]/api/timestamp/:date_string?`\n2. A date string is valid if it can be successfully parsed by `new Date(date_string)` (JS) . Note that the unix timestamp needs to be an **integer** (not a string) specifying **milliseconds**. In our test we will use date strings compliant with ISO-8601 (e.g. `\"2016-11-20\"`) because this will ensure an UTC timestamp.\n3. If the date string is **empty** it should be equivalent to trigger `new Date()`, i.e. the service uses the current timestamp.\n4. If the date string is **valid** the api returns a JSON having the structure\n`{\"unix\": \u003cdate.getTime()\u003e, \"utc\" : \u003cdate.toUTCString()\u003e }`\ne.g. `{\"unix\": 1479663089000 ,\"utc\": \"Sun, 20 Nov 2016 17:31:29 GMT\"}`.\n5. If the date string is **invalid** the api returns JSON having the structure `{\"unix\": null, \"utc\" : \"Invalid Date\" }`. It is what you get from the date manipulation functions used above.\n\n## :camera: Screenshots\n\n![Example screenshot](./img/home.png).\n![Example screenshot](./img/timestamp.png).\n\n## :signal_strength: Technologies\n\n* [Node v16](https://nodejs.org/en/) javaScript runtime built on Chrome's V8 JavaScript engine\n* [Express v4](https://expressjs.com/) Fast, unopinionated, minimalist web framework for Node.js. Includes body-parsing\n* [Cors v2](https://www.npmjs.com/package/cors) node.js package for providing Connect/Express middleware that can be used to enable CORS with various options.\n\n## :floppy_disk: Setup\n\n* `npm i` to install dependencies\n* `npm run start` for a dev server.\n* Navigate to `http://localhost:8080/` for home screen.\n* Navigate to `http://localhost:8080/api/timestamp/` for current time stamp\n* Navigate to `http://localhost:8080/api/timestamp/2022-04-12` date-string for example to see json object with unix and utc timestamps\n* Navigate to `http://localhost:8080/api/timestamp/1598659200` unix timestamp for example to see json object with unix and utc timestamps\n* The app will not automatically reload if you change any of the source files.\n\n## :computer: Code Examples\n\n* extract from `server.js` to return current timestamp\n\n```javascript\n// API endpoint for no date entry...\napp.get(\"/api/timestamp/\", function (req, res) {\n  let dateNow = new Date()\n  res.json({\n    unix: dateNow.getTime(),\n    utc: dateNow.toUTCString()\n  });\n});\n```\n\n## :cool: Features\n\n* UNIX and UTC timestamps shown\n\n## :clipboard: Status \u0026 To-Do List\n\n* Status: Working\n* To-Do: Nothing\n\n## :clap: Inspiration\n\n* [freeCodeCamp's APIs and Microservices Projects - Timestamp Microservice](https://www.freecodecamp.org/learn/apis-and-microservices/apis-and-microservices-projects/timestamp-microservice)\n* [Express doc: Serving static files in Express](http://expressjs.com/en/starter/static-files.html) such as images, CSS files, and JavaScript files\n* [Express doc: Basic Routing](http://expressjs.com/en/starter/basic-routing.html) basic structure: `app.METHOD(PATH, HANDLER)`\n\n## :envelope: Contact\n\n* Repo created by [ABateman](https://github.com/AndrewJBateman), email: gomezbateman@yahoo.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Ftimestampunix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewjbateman%2Ftimestampunix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewjbateman%2Ftimestampunix/lists"}