0 purchases
date utility
Date Utility #
A Project for get date methods
Feature #
Get date function
⠀
⠀
Example #
Convert milliseconds to date
Example 1:
DateUtility.millisecondToDate(1715365800000, formatPattern: 'yyyy-MM-dd',); // 2024-05-11
copied to clipboard
Example 2:
DateUtility.millisecondToDate(1715365800000, formatPattern: 'd MMM yyyy',); // 11 May 2024
copied to clipboard
Convert date to milliseconds
Example 1:
DateUtility.dateToMillisecond('2024-05-11'); // 1715365800000
copied to clipboard
Example 2:
DateUtility.dateToMillisecond('11 May 2024'); // 1715365800000
copied to clipboard
Change date format
Example 1:
DateUtility.changeDateFormat('2024-05-11', '11 May 2024'); // 2024-05-11 convert to 11 May 2024
copied to clipboard
Example 2:
DateUtility.changeDateFormat('11 May 2024', '2024-05-11'); // 11 May 2024 convert to 2024-05-11
copied to clipboard
Count days
Example 1:
DateUtility.daysBetween('2024-05-10', '2024-05-11'); // 1 days
copied to clipboard
Example 2:
DateUtility.daysBetweenWithMilliSecond(1715279400000, 1715365800000); // 1 days
copied to clipboard
Time ago
Example 1:
DateUtility.timeAgoSinceDate('2024-05-10', numericDates: true,); // 1 day ago
copied to clipboard
Example 2:
DateUtility.timeAgoSinceMilliseconds(1715279400000, numericDates: true,); // 1 days ago
copied to clipboard
numericDates = true
numericDates = false
1 minute ago
A minute ago
1 hour ago
An hour ago
1 day ago
Yesterday
1 week ago
Last week
1 month ago
Last month
1 year ago
Last year
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.