Time

μ†Œκ°œ

ZEP μ„œλ²„μ˜ μ‹œκ°„μ„ μ‘°νšŒν•˜λŠ” λ“± μ‹œκ°„ 데이터λ₯Ό κ°€μ Έμ˜€λŠ” ν•¨μˆ˜λ₯Ό λͺ¨μ•„놓은 ν΄λž˜μŠ€μž…λ‹ˆλ‹€.

Methods

이름
μ„€λͺ…

getTime

ZEP μ„œλ²„μ˜ ν˜„μž¬ μ‹œκ°„μ„ milliseconds λ‹¨μœ„μ˜ κ°’μœΌλ‘œ λ¦¬ν„΄ν•©λ‹ˆλ‹€.

getUtcTime

ν˜„μž¬ UTC μ‹œκ°„μ„ milliseconds λ‹¨μœ„μ˜ κ°’μœΌλ‘œ λ¦¬ν„΄ν•©λ‹ˆλ‹€.

getTimeInterval

νŒŒλΌλ―Έν„°λ‘œ μž…λ ₯ν•œ 두 μ‹œκ°„μ˜ 차이λ₯Ό 계산해 값을 λ¦¬ν„΄ν•©λ‹ˆλ‹€.

getTime

Time.getTime()

ZEP μ„œλ²„μ˜ ν˜„μž¬ μ‹œκ°„μ„ milliseconds λ‹¨μœ„μ˜ κ°’μœΌλ‘œ λ¦¬ν„΄ν•©λ‹ˆλ‹€.

예제

// Qλ₯Ό λˆ„λ₯΄λ©΄ λ™μž‘ν•˜λŠ” ν•¨μˆ˜
App.addOnKeyDown(KeyCodeType.q, (player)=>{
    player.sendMessage(`Server Time: ${Time.getTime()}`);
});

getUtcTime

Time.getUtcTime()

ν˜„μž¬ UTC μ‹œκ°„μ„ milliseconds λ‹¨μœ„μ˜ κ°’μœΌλ‘œ λ¦¬ν„΄ν•©λ‹ˆλ‹€.

예제

// Qλ₯Ό λˆ„λ₯΄λ©΄ λ™μž‘ν•˜λŠ” ν•¨μˆ˜
App.addOnKeyDown(KeyCodeType.q, (player)=>{
    player.sendMessage(`UTC Time: ${Time.getUtcTime()}`);
});

getTimeInterval

Time.getTimeInterval(timeA: number, timeB: number, returnType: DateType)

timeB - timeAλ₯Ό κ³„μ‚°ν•˜κ³ , κ·Έ κ²°κ³Όλ₯Ό μ§€μ •ν•œ returnType으둜 λ°˜ν™˜ν•©λ‹ˆλ‹€.

νŒŒλΌλ―Έν„°

이름
νƒ€μž…
μ„€λͺ…

timeA, timeB

Number

차이λ₯Ό 계산할 μ‹œκ°„ (milliseconds)

returnType

DateType

DateType.MILLISECONDS ( ms λ‹¨μœ„ )

DateType.SECONDS (초 λ‹¨μœ„ )

DateType.MINUTES ( λΆ„ λ‹¨μœ„ )

DateType.HOURS ( μ‹œκ°„ λ‹¨μœ„ )

DateType.DAYS ( 일 λ‹¨μœ„ )

예제

// Qλ₯Ό λˆ„λ₯΄λ©΄ λ™μž‘ν•˜λŠ” ν•¨μˆ˜
App.addOnKeyDown(KeyCodeType.q, (player)=>{
    const currentTime = Time.getTime();
    const utcTime = Time.getUtcTime();
    player.sendMessage(`timeInterval: ${Time.getTimeInterval(currentTime, utcTime, DateType.MILLISECONDS)}`);
})

Last updated