Skip to content

Commit

Permalink
feat(cast): toMillisecondsSinceEpoch
Browse files Browse the repository at this point in the history
  • Loading branch information
uladkasach committed May 26, 2024
1 parent 967c8c7 commit c91cd01
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/casts/toMillisecondsSinceEpoch.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { UniDate, UniDateTime } from '../domain/UniDateTime';

export const toMillisecondsSinceEpoch = (
input: UniDate | UniDateTime,
): number => new Date(input).getTime();

export { toMillisecondsSinceEpoch as toMse };
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export * from './domain/UniDuration';
export * from './utils/sleep';
export * from './checks/isUniDate';
export * from './checks/isUniDateTime';
export * from './casts/toMillisecondsSinceEpoch';

0 comments on commit c91cd01

Please sign in to comment.