Jump to content

Time formatting: Difference between revisions

From fCraft Wiki
Created page with "fCraft uses a compact way to represent time intervals. Here is a brief explaination: ==Format== The time is made up of one or more pairs of numbers and letters. The letter stand..."
 
No edit summary
 
(7 intermediate revisions by the same user not shown)
Line 2: Line 2:


==Format==
==Format==
The time is made up of one or more pairs of numbers and letters. The letter stands for different units:
The string is made up of one or more pairs of numbers and letters. The letter stands for different units:
{|class="wikitable"
{|class="wikitable"
|'''s'''||seconds
|'''s'''||seconds
Line 14: Line 14:
|'''w'''||weeks
|'''w'''||weeks
|}
|}
You may combine different units in the same string. Do not use spaces. '''At least one digit, and at least one unit must be given.''' See examples below.


==Examples==
==Examples==
Line 20: Line 22:
!Full Form
!Full Form
|-
|-
|45s||45 seconds
|45'''s'''
|45 seconds
|-
|-
|1m30s
|1'''m'''30'''s'''
|rowspan="2"|1 minute and 30 seconds
|rowspan="2"|1 minute and 30 seconds
|-
|-
|90s
|90'''s'''
|-
|-
|1h30m
|1'''h'''30'''m'''
|rowspan="3"|1 hour and 30 minutes
|rowspan="3"|1 hour and 30 minutes
|-
|-
|90m
|90'''m'''
|-
|-
|5400s
|5400'''s'''
|-
|-
|2d10h
|2'''d'''10'''h'''
|2 days and 10 hours
|2 days and 10 hours
|-
|-
|1w2d3h
|1'''w'''2'''d'''3'''h'''
|1 week, 2 days, and 3 hours
|1 week, 2 days, and 3 hours
|}
|}

Latest revision as of 10:41, 25 August 2013

fCraft uses a compact way to represent time intervals. Here is a brief explaination:

Format

The string is made up of one or more pairs of numbers and letters. The letter stands for different units:

s seconds
m minutes
h hours
d days
w weeks

You may combine different units in the same string. Do not use spaces. At least one digit, and at least one unit must be given. See examples below.

Examples

Compact Form Full Form
45s 45 seconds
1m30s 1 minute and 30 seconds
90s
1h30m 1 hour and 30 minutes
90m
5400s
2d10h 2 days and 10 hours
1w2d3h 1 week, 2 days, and 3 hours