ਫਰਮਾ:Time ago/testcases

Trailing space tests

Purge

1 Jan 2012:

  • >13 ਸਾਲ ਪਹਿਲਾਂ<
  • >13 years ago<sbx

current time:

  • >0 ਸਕਿੰਟ ਪਹਿਲਾਂ<
  • >0 seconds ago<sbx

1 Jan 2012, with purge

current time with purge:

Line break test (no purge)

live>0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ)<<

sbx>0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge)<<

Line break test (purge can appear at start of line)

live>0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ) 0 ਸਕਿੰਟ ਪਹਿਲਾਂ (ਤਾਜ਼ਾ ਕਰੋ)<<

sbx>0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge) 0 seconds ago (purge)<<

Sandbox tests

  • Normal: 16 years ago
  • Minutes: 8421509 minutes ago
  • Days: 5848 days ago
  • Weeks: 835 weeks ago
  • Months: 192 months ago
  • Future: 287 months' time

Errors

  • Bad date: Error: first parameter cannot be parsed as a date or time.
  • Unknown specified magnitude: 505290598 seconds ago
  • No parameters: 0 seconds ago
  • Capitalization: 505290598 seconds ago

min_magnitude

no seconds minutes hours days months years nonsense
-111 seconds 111 seconds ago 111 seconds ago 1 minute ago 0 hours ago 0 days ago 0 months ago 0 years ago 111 seconds ago
-30 minutes 30 minutes ago 30 minutes ago 30 minutes ago 0 hours ago 0 days ago 0 months ago 0 years ago 30 minutes ago
5 ਜੁਲਾਈ 2025 Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time.
-25 hours 25 hours ago 25 hours ago 25 hours ago 25 hours ago 1 day ago 0 months ago 0 years ago 25 hours ago
1 January 2010 15 years ago 15 years ago 15 years ago 15 years ago 15 years ago 15 years ago 15 years ago 15 years ago
17 November 2009 15 years ago 15 years ago 15 years ago 15 years ago 15 years ago 15 years ago 15 years ago 15 years ago
20 May 1988 37 years ago 37 years ago 37 years ago 37 years ago 37 years ago 37 years ago 37 years ago 37 years ago
5 months 5 months' time 5 months' time 5 months' time 5 months' time 5 months' time 5 months' time 0 years' time 5 months' time

Original version tests

  • Normal: 16 ਸਾਲ ਪਹਿਲਾਂ
  • Minutes: 505290598 ਸਕਿੰਟ ਪਹਿਲਾਂ
  • Days: 505290598 ਸਕਿੰਟ ਪਹਿਲਾਂ
  • Weeks: 505290598 ਸਕਿੰਟ ਪਹਿਲਾਂ
  • Months: 505290598 ਸਕਿੰਟ ਪਹਿਲਾਂ
  • Future: 757013402 ਸਕਿੰਟਾਂ ਦਾ ਸਮਾਂ

Errors

  • Bad date: Error: first parameter cannot be parsed as a date or time.
  • Unknown specified magnitude: 505290598 ਸਕਿੰਟ ਪਹਿਲਾਂ
  • No parameters: 0 ਸਕਿੰਟ ਪਹਿਲਾਂ
  • Capitalization: 505290598 ਸਕਿੰਟ ਪਹਿਲਾਂ

min_magnitude

no seconds minutes hours days months years nonsense
-111 seconds 111 ਸਕਿੰਟ ਪਹਿਲਾਂ 111 ਸਕਿੰਟ ਪਹਿਲਾਂ 111 ਸਕਿੰਟ ਪਹਿਲਾਂ 111 ਸਕਿੰਟ ਪਹਿਲਾਂ 111 ਸਕਿੰਟ ਪਹਿਲਾਂ 111 ਸਕਿੰਟ ਪਹਿਲਾਂ 111 ਸਕਿੰਟ ਪਹਿਲਾਂ 111 ਸਕਿੰਟ ਪਹਿਲਾਂ
-30 minutes 30 ਮਿੰਟ ਪਹਿਲਾਂ 30 ਮਿੰਟ ਪਹਿਲਾਂ 30 ਮਿੰਟ ਪਹਿਲਾਂ 30 ਮਿੰਟ ਪਹਿਲਾਂ 30 ਮਿੰਟ ਪਹਿਲਾਂ 30 ਮਿੰਟ ਪਹਿਲਾਂ 30 ਮਿੰਟ ਪਹਿਲਾਂ 30 ਮਿੰਟ ਪਹਿਲਾਂ
5 ਜੁਲਾਈ 2025 Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time. Error: first parameter cannot be parsed as a date or time.
-25 hours 25 ਘੰਟੇ ਪਹਿਲਾਂ 25 ਘੰਟੇ ਪਹਿਲਾਂ 25 ਘੰਟੇ ਪਹਿਲਾਂ 25 ਘੰਟੇ ਪਹਿਲਾਂ 25 ਘੰਟੇ ਪਹਿਲਾਂ 25 ਘੰਟੇ ਪਹਿਲਾਂ 25 ਘੰਟੇ ਪਹਿਲਾਂ 25 ਘੰਟੇ ਪਹਿਲਾਂ
1 January 2010 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ
17 November 2009 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ 15 ਸਾਲ ਪਹਿਲਾਂ
20 May 1988 37 ਸਾਲ ਪਹਿਲਾਂ 37 ਸਾਲ ਪਹਿਲਾਂ 37 ਸਾਲ ਪਹਿਲਾਂ 37 ਸਾਲ ਪਹਿਲਾਂ 37 ਸਾਲ ਪਹਿਲਾਂ 37 ਸਾਲ ਪਹਿਲਾਂ 37 ਸਾਲ ਪਹਿਲਾਂ 37 ਸਾਲ ਪਹਿਲਾਂ
5 months Lua error in ਮੌਡਿਊਲ:Time_ago at line 98: attempt to index field '?' (a nil value). Lua error in ਮੌਡਿਊਲ:Time_ago at line 98: attempt to index field '?' (a nil value). Lua error in ਮੌਡਿਊਲ:Time_ago at line 98: attempt to index field '?' (a nil value). Lua error in ਮੌਡਿਊਲ:Time_ago at line 98: attempt to index field '?' (a nil value). Lua error in ਮੌਡਿਊਲ:Time_ago at line 98: attempt to index field '?' (a nil value). Lua error in ਮੌਡਿਊਲ:Time_ago at line 98: attempt to index field '?' (a nil value). Lua error in ਮੌਡਿਊਲ:Time_ago at line 98: attempt to index field '?' (a nil value). Lua error in ਮੌਡਿਊਲ:Time_ago at line 98: attempt to index field '?' (a nil value).

Now works in the future

  • Original: 32 ਸਾਲਾਂ ਦਾ ਸਮਾਂ
  • Sandbox: 32 years' time

Non-breaking space

Test using a non-breaking space between the number and the units (year, month, day, etc). A breaking space is used between the units and "ago" (similar to the output of Template:Start date and years ago).

These examples are placed inside a narrow <div> to force a line break. They are based on the current date and time, which is: 2025-07-05 06:29:58 (UTC). If that is not correct, click Purge to update the page.

Example Current output Sandbox output
{{Time ago|-13 months|min_magnitude=years}}
Lua error in ਮੌਡਿਊਲ:Time_ago at line 98: attempt to index field '?' (a nil value).
1 year ago
{{Time ago|-32 days|min_magnitude=months}}
32 ਦਿਨ ਪਹਿਲਾਂ
1 month ago
{{Time ago|-25 hours|min_magnitude=days}}
25 ਘੰਟੇ ਪਹਿਲਾਂ
1 day ago
{{Time ago|-65 minutes|min_magnitude=hours}}
65 ਮਿੰਟ ਪਹਿਲਾਂ
1 hour ago
{{Time ago|-75 seconds|min_magnitude=minutes}}
75 ਸਕਿੰਟ ਪਹਿਲਾਂ
1 minute ago
{{Time ago|-15 seconds|min_magnitude=seconds}}
15 ਸਕਿੰਟ ਪਹਿਲਾਂ
15 seconds ago

Blank values of ago

  • He has worked for FooBar Corp for the last {{time ago|1 January 1985|ago=}}.
Main

He has worked for FooBar Corp for the last 40 ਸਾਲ ਪਹਿਲਾਂ.

Sandbox

He has worked for FooBar Corp for the last 40 years.

Blank future values of ago

  • {{time ago|1 January {{#expr: {{CURRENTYEAR}} + 5}}|ago=}}
Main

4 ਸਾਲਾਂ ਦਾ ਸਮਾਂ

Sandbox

4 years

  • {{time ago|{{#time:c|+ 1 second}}|ago=}}
Main

1 ਸਕਿੰਟ ਦਾ ਸਮਾਂ

Sandbox

1 second

Comparing hours, days, and weeks for the same time periods

{{Time ago}}

0 ਸਕਿੰਟ ਪਹਿਲਾਂ

{{Time ago/sandbox}}

0 seconds ago

{{Time ago}}

0 ਸਕਿੰਟ ਪਹਿਲਾਂ

{{Time ago/sandbox}}

0 seconds ago

{{Time ago}}

0 ਸਕਿੰਟ ਪਹਿਲਾਂ

{{Time ago/sandbox}}

0 seconds ago

{{Time ago}}

0 ਸਕਿੰਟ ਪਹਿਲਾਂ

{{Time ago/sandbox}}

0 seconds ago

{{Time ago}}

0 ਸਕਿੰਟ ਪਹਿਲਾਂ

{{Time ago/sandbox}}

0 seconds ago

{{Time ago}}

0 ਸਕਿੰਟ ਪਹਿਲਾਂ

{{Time ago/sandbox}}

0 seconds ago

{{Time ago}}

0 ਸਕਿੰਟ ਪਹਿਲਾਂ

{{Time ago/sandbox}}

0 seconds ago

{{Time ago}}

0 ਸਕਿੰਟ ਪਹਿਲਾਂ

{{Time ago/sandbox}}

0 seconds ago

{{Time ago}}

0 ਸਕਿੰਟ ਪਹਿਲਾਂ

{{Time ago/sandbox}}

0 seconds ago



Prefix: a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9

Portal di Ensiklopedia Dunia

Kembali kehalaman sebelumnya