MCPcopy Create free account
hub / github.com/omkarcloud/botasaurus / convertStringToDate

Function convertStringToDate

js/botasaurus-js/src/decorators-common.ts:85–96  ·  view source on GitHub ↗
(dateString:any)

Source from the content-addressed store, hash-verified

83const pad = (num:any) => num.toString().padStart(2, '0');
84
85function convertStringToDate(dateString:any) {
86 // Split the string into date and time parts
87 const [datePart, timePart] = dateString.split('_');
88
89 // Split date and time into components
90 const [year, month, day] = datePart.split('-');
91 const [hours, minutes, seconds] = timePart.split('-');
92
93 // Create a new Date object
94 // Note: months are 0-indexed in JavaScript Date objects
95 return new Date(year, month - 1, day, hours, minutes, seconds);
96}
97function getCurrentFormattedDate() {
98 const now = new Date();
99

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected