# Wrong Time Set within the zoom API

**URL:** <https://devforum.zoom.us/t/wrong-time-set-within-the-zoom-api/110705>\
**Category:** API and Webhooks\
**Tags:** api\
**Created:** [May 26, 2024, 3:23am UTC](https://devforum.zoom.us/t/wrong-time-set-within-the-zoom-api/110705 "2024-05-26T03:23:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![codecrafty](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/codecrafty/32/60051_2.png) [@codecrafty](https://devforum.zoom.us/u/codecrafty)\
**Post date:** [May 26, 2024, 3:23am UTC](https://devforum.zoom.us/t/wrong-time-set-within-the-zoom-api/110705/1 "2024-05-26T03:23:29Z")

</div>

I have a next js 13, typescript and Prisma, project and I am trying to implement the create a zoom call Api in my code:

I do successfully get a meeting, but the time is wrong. So, I choose Say May 28th at 10am and I get May 28th at 4am. I can’t figure out why.

My Server Code:  
import { NextRequest, NextResponse } from “next/server”;  
import prisma from “@/lib/prisma”;  
import { scheduleZoomMeeting } from “@/lib/zoom”;  
import { formatInTimeZone, toDate } from “date-fns-tz”;  
import { parseISO, format } from “date-fns”;

export async function POST(request: NextRequest) {  
try {  
const {  
name,  
email,  
businessName,  
phoneNumber,  
country,  
callTime,  
callDate,  
timeZone,  
notes,  
contactAgreement,  
} = await request.json();

```
console.log("Received values:", {
  name,
  email,
  businessName,
  phoneNumber,
  country,
  callTime,
  callDate,
  timeZone,
  notes,
  contactAgreement,
});

// Combine date and time into a single string
const dateTimeStr = `${callDate}T${callTime}`;
console.log("Combined dateTimeStr:", dateTimeStr);

// Parse the date and time string using date-fns
const parsedDate = parseISO(dateTimeStr);
console.log("Parsed date:", parsedDate);

if (isNaN(parsedDate.getTime())) {
  throw new Error("Invalid date or time value");
}

// Convert the parsed date to the desired time zone
const zonedDate = toDate(parsedDate, { timeZone });
console.log("Zoned date:", zonedDate);

// Format the date in UTC
const formattedDate = formatInTimeZone(
  zonedDate,
  "UTC",
  "yyyy-MM-dd'T'HH:mm:ssXXX"
);
console.log("Formatted date:", formattedDate);

// Create a Zoom meeting using the access token
const zoomMeeting = await scheduleZoomMeeting({
  topic: `Meeting with ${name}`,
  start_time: formattedDate,
  duration: 30,
});

// Ensure zoom_meeting_id is treated as a string
const zoomMeetingId = String(zoomMeeting.id);

// Create a new schedule in the database with Zoom meeting details
const newSchedule = await prisma.scheduleCall.create({
  data: {
    name,
    email,
    business_name: businessName,
    phone_number: phoneNumber,
    country,
    call_time: callTime,
    call_date: callDate,
    time_zone: timeZone,
    notes,
    contact_agreement: contactAgreement,
    zoom_meeting_id: zoomMeetingId,
    zoom_meeting_join_url: zoomMeeting.join_url,
    zoom_meeting_start_url: zoomMeeting.start_url,
  },
});

return NextResponse.json(newSchedule, { status: 200 });

```

} catch (error) {  
console.error(“Error scheduling call:”, error);  
if (error instanceof Error) {  
return NextResponse.json(  
{ error: “Failed to schedule call”, details: error.message },  
{ status: 500 }  
);  
} else {  
return NextResponse.json(  
{  
error: “Failed to schedule call”,  
details: “An unknown error occurred”,  
},  
{ status: 500 }  
);  
}  
}  
}

some logs: form the code:  
Received values: {  
name: ‘dewfa’,  
email: ‘davidfales@codecrafty.dev’,  
businessName: ‘Code Crafty LLC’,  
phoneNumber: ‘7206122979’,  
country: ‘United States’,  
callTime: ‘10:00:00’,  
callDate: ‘2024-05-28’,  
timeZone: ‘America/Denver’,  
notes: ‘deqwdd’,  
contactAgreement: true  
}

Combined dateTimeStr: 2024-05-28T10:00:00

Parsed date: 2024-05-28T10:00:00.000Z

Zoned date: 2024-05-28T10:00:00.000Z

Formatted date: 2024-05-28T10:00:00Z

Scheduling Zoom meeting with details: {  
topic: ‘Meeting with dewfa’,  
start\_time: ‘2024-05-28T10:00:00Z’,  
duration: 30  
}

Zoom meeting scheduled successfully: {  
uuid: ‘WJleG7dcTmmlN8UaTjxWdA==’,  
id: 82875979312,  
host\_id: ‘pB3H0HTvRwiagoYWfa1YXg’,  
host\_email: ‘admin@codecrafty.dev’,  
topic: ‘Meeting with dewfa’,  
type: 2,  
status: ‘waiting’,  
start\_time: ‘2024-05-28T10:00:00Z’,  
duration: 30,  
timezone: ‘America/Denver’,  
created\_at: ‘2024-05-26T03:19:41Z’,  
start\_url: zak=eyJ0eXAiOiJKV1QiLCJzdiI6IjAwMDAwMSIsInptX3NrbSI6InptX28ybSIsImFsZyI6IkhTMjU2In0.eyJhdWQiOiJjbGllbnRzbSIsInVpZCI6InBCM0gwSFR2UndpYWdvWVdmYTFZWGciLCJpc3MiOiJ3ZWIiLCJzayI6IjAiLCJzdHkiOjEsIndjZCI6InVzMDUiLCJjbHQiOjAsIm1udW0iOiI4Mjg3NTk3OTMxMiIsImV4cCI6MTcxNjcwMDc4MSwiaWF0IjoxNzE2NjkzNTgxLCJhaWQiOiJEQk9LQXhPZlJKaW5mVUR1LUk3ZkNBIiwiY2lkIjoiIn0.RX9LL0gFgiCxs-2TMGHt74zG1EKckSmJTQqyxxM-GvI’,  
join\_url:  
pwd=62bn8ivdG1kdcYQxkrfLx5bV9VoB7y.1’,  
password: ‘NbHW6x’,  
h323\_password: ‘918112’,  
pstn\_password: ‘918112’,  
encrypted\_password: ‘62bn8ivdG1kdcYQxkrfLx5bV9VoB7y.1’,  
settings: {  
host\_video: false,  
participant\_video: false,  
cn\_meeting: false,  
in\_meeting: false,  
join\_before\_host: true,  
jbh\_time: 0,  
mute\_upon\_entry: false,  
watermark: false,  
use\_pmi: false,  
approval\_type: 2,  
audio: ‘voip’,  
auto\_recording: ‘none’,  
enforce\_login: false,  
enforce\_login\_domains: ‘’,  
alternative\_hosts: ‘’,  
alternative\_host\_update\_polls: false,  
close\_registration: false,  
show\_share\_button: false,  
allow\_multiple\_devices: false,  
registrants\_confirmation\_email: true,  
waiting\_room: false,  
request\_permission\_to\_unmute\_participants: false,  
registrants\_email\_notification: true,  
meeting\_authentication: false,  
encryption\_type: ‘enhanced\_encryption’,  
approved\_or\_denied\_countries\_or\_regions: { enable: false },  
breakout\_room: { enable: false },  
internal\_meeting: false,  
continuous\_meeting\_chat: { enable: false, auto\_add\_invited\_external\_users: false },  
participant\_focused\_meeting: false,  
push\_change\_to\_calendar: false,  
resources: ,  
auto\_start\_meeting\_summary: false,  
alternative\_hosts\_email\_notification: true,  
show\_join\_info: false,  
device\_testing: false,  
focus\_mode: false,  
meeting\_invitees: ,  
enable\_dedicated\_group\_chat: false,  
private\_meeting: false,  
email\_notification: true,  
host\_save\_video\_order: false,  
sign\_language\_interpretation: { enable: false },  
email\_in\_attendee\_report: false  
},  
pre\_schedule: false  
}

Any help would be nice. I’ve seen in some places its a time zone thing that its auto UTC but I tried to fix that and I couldn’t.

---

<div class="post-metadata">

**Author:** ![philip.ross](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/philip.ross/32/19627_2.png) [@philip.ross](https://devforum.zoom.us/u/philip.ross)\
**Post date:** [May 28, 2024, 7:20am UTC](https://devforum.zoom.us/t/wrong-time-set-within-the-zoom-api/110705/2 "2024-05-28T07:20:50Z")

</div>

Does setting the time to 4pm schedule it at 10am local time?

`2024-05-28T16:00:00Z`

---

<div class="post-metadata">

**Author:** ![philip.ross](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/philip.ross/32/19627_2.png) [@philip.ross](https://devforum.zoom.us/u/philip.ross)\
**Post date:** [May 30, 2024, 8:42pm UTC](https://devforum.zoom.us/t/wrong-time-set-within-the-zoom-api/110705/3 "2024-05-30T20:42:58Z")

</div>

I’ve had another re-read of the documentation.  
Looks like it could be a case of dropping the Z from the time provided, as if you’re using a Timezone, and want to use local time, this isn’t needed.  
Possibly adding the Z is defaulting it to UTC, whereas you want local time with the use of the Timezone parameter:

> **[Zoom Meeting API](https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetingCreate)**
>
> API Reference for /docs/api/rest/reference/zoom-api/methods

> The meeting’s start time. This field is only used for scheduled or recurring meetings with a fixed time. This supports local time and GMT formats.

- To set a meeting’s start time in GMT, use the `yyyy-MM-ddTHH:mm:ssZ` date-time format. For example, `2020-03-31T12:02:00Z`.
- To set a meeting’s start time using a specific timezone, use the `yyyy-MM-ddTHH:mm:ss` date-time format and specify the [timezone ID](https://developers.zoom.us/docs/api/rest/other-references/abbreviation-lists/#timezones) in the `timezone` field. If you do not specify a timezone, the `timezone` value defaults to your Zoom account’s timezone. You can also use `UTC` for the `timezone` value. **Note:** If no `start_time` is set for a scheduled meeting, the `start_time` is set at the current time and the meeting type changes to an instant meeting, which expires after 30 days.

---

<div class="post-metadata">

**Author:** ![gpemail0987](https://avatars.discourse-cdn.com/v4/letter/g/e19adc/32.png) [@gpemail0987](https://devforum.zoom.us/u/gpemail0987)\
**Post date:** [August 4, 2024, 4:50am UTC](https://devforum.zoom.us/t/wrong-time-set-within-the-zoom-api/110705/4 "2024-08-04T04:50:22Z")

</div>

I got the same problem too.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [August 7, 2025, 8:26pm UTC](https://devforum.zoom.us/t/wrong-time-set-within-the-zoom-api/110705/5 "2025-08-07T20:26:54Z")

</div>

Closed on August 7, 2025, 8:26pm UTC

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.
