MCPcopy Index your code
hub / github.com/aiprodcoder/MIXAPI / timestamp2string

Function timestamp2string

web/src/helpers/utils.js:166–192  ·  view source on GitHub ↗
(timestamp)

Source from the content-addressed store, hash-verified

164}
165
166export function timestamp2string(timestamp) {
167 let date = new Date(timestamp * 1000);
168 let year = date.getFullYear().toString();
169 let month = (date.getMonth() + 1).toString();
170 let day = date.getDate().toString();
171 let hour = date.getHours().toString();
172 let minute = date.getMinutes().toString();
173 let second = date.getSeconds().toString();
174 if (month.length === 1) {
175 month = '0' + month;
176 }
177 if (day.length === 1) {
178 day = '0' + day;
179 }
180 if (hour.length === 1) {
181 hour = '0' + hour;
182 }
183 if (minute.length === 1) {
184 minute = '0' + minute;
185 }
186 if (second.length === 1) {
187 second = '0' + second;
188 }
189 return (
190 year + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
191 );
192}
193
194export function timestamp2string1(timestamp, dataExportDefaultTime = 'hour') {
195 let date = new Date(timestamp * 1000);

Callers 8

TaskLogsTable.jsFile · 0.90
MjLogsTable.jsFile · 0.90
ChannelsTable.jsFile · 0.90
LogsTable.jsFile · 0.90
getStartTimeStringFunction · 0.90
setExpiredTimeFunction · 0.90
loadTokenFunction · 0.90
index.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected