Professional Documents
Culture Documents
India Date Time
India Date Time
// or
const date = new Date('2023-09-21T05:22:15.693+00:00');
const ist = date.toLocaleString('en-US', { timeZone: 'Asia/Kolkata' });
// or
// const date = new Date();
// const ist = date.toLocaleString('en-US', { timeZone: 'Asia/Kolkata' });
// or schema
// const yourSchema = new mongoose.Schema({
// yourField: {
// type: Date,
// default: function () {
// // Get the current date and time in the Indian time zone (+5:30 offset)
// const indianTime = new Date();
// indianTime.setHours(indianTime.getHours() + 5);
// indianTime.setMinutes(indianTime.getMinutes() + 30);
// return indianTime;
// },
// },