Skip to content

Instantly share code, notes, and snippets.

Dave Mitchell digitalbias

Block or report user

Report or block digitalbias

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View date_testing.ts
function zeroPad(num: number, count: number, radix: number = 10): string {
if (num < 0) return "-" + zeroPad(-num, count, radix);
const str = (num | 0).toString(radix);
if (str.length > count) return str;
return ("0".repeat(count) + str).substr(-count);
function formatDate(date: Date) {
return zeroPad(date.getFullYear(), 4) + "-" + zeroPad(date.getMonth()+1, 2) + "-" + zeroPad(date.getDate(), 2)

Keybase proof

I hereby claim:

  • I am digitalbias on github.
  • I am digitalbias ( on keybase.
  • I have a public key whose fingerprint is 8797 59FB 81C0 FC66 5213 877B 1C3F 6F24 2652 5289

To claim this, I am signing this object:

You can’t perform that action at this time.