Skip to content

Commit

Permalink
Update DateTime.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
kekefreedog committed May 3, 2024
1 parent 87c78d9 commit 3d387d7
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/Front/Library/Utility/DateTime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,19 @@ export default class DateTime {
return `${year}${month}${day}`;
}

/**
* Get Today Date YYYYMMDD
*
* @returns
*/
public static getTodayDateYYYYMMDD = ():string => {
const date = new Date();
const year = date.getFullYear().toString(); // Get last two digits of the year
const month = (date.getMonth() + 1).toString().padStart(2, '0'); // Months are 0-indexed, pad with zero
const day = date.getDate().toString().padStart(2, '0'); // Pad with zero if needed
return `${year}${month}${day}`;
}

/**
* Convert Date Fromat
*
Expand Down

0 comments on commit 3d387d7

Please sign in to comment.