ਫਰਮਾ:Time ago/testcases

ਵਿਕੀਪੀਡੀਆ, ਇੱਕ ਅਜ਼ਾਦ ਗਿਆਨਕੋਸ਼ ਤੋਂ

Trailing space tests[ਸੋਧੋ]

Purge

1 Jan 2012:

  • >12 ਸਾਲ ਪਹਿਲਾਂ<
  • >12 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: 14 years ago
  • Minutes: 7809157 minutes ago
  • Days: 5423 days ago
  • Weeks: 774 weeks ago
  • Months: 178 months ago
  • Future: 301 months' time

Errors[ਸੋਧੋ]

  • Bad date: Error: first parameter cannot be parsed as a date or time.
  • Unknown specified magnitude: 468549456 seconds ago
  • No parameters: 0 seconds ago
  • Capitalization: 468549456 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
6 ਮਈ 2024 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 14 years ago 14 years ago 14 years ago 14 years ago 14 years ago 14 years ago 14 years ago 14 years ago
17 November 2009 14 years ago 14 years ago 14 years ago 14 years ago 14 years ago 14 years ago 14 years ago 14 years ago
20 May 1988 35 years ago 35 years ago 35 years ago 35 years ago 35 years ago 35 years ago 35 years ago 35 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: 14 ਸਾਲ ਪਹਿਲਾਂ
  • Minutes: 468549456 ਸਕਿੰਟ ਪਹਿਲਾਂ
  • Days: 468549456 ਸਕਿੰਟ ਪਹਿਲਾਂ
  • Weeks: 468549456 ਸਕਿੰਟ ਪਹਿਲਾਂ
  • Months: 468549456 ਸਕਿੰਟ ਪਹਿਲਾਂ
  • Future: 793754544 ਸਕਿੰਟਾਂ ਦਾ ਸਮਾਂ

Errors[ਸੋਧੋ]

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

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 ਮਿੰਟ ਪਹਿਲਾਂ
6 ਮਈ 2024 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 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ
17 November 2009 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ 14 ਸਾਲ ਪਹਿਲਾਂ
20 May 1988 35 ਸਾਲ ਪਹਿਲਾਂ 35 ਸਾਲ ਪਹਿਲਾਂ 35 ਸਾਲ ਪਹਿਲਾਂ 35 ਸਾਲ ਪਹਿਲਾਂ 35 ਸਾਲ ਪਹਿਲਾਂ 35 ਸਾਲ ਪਹਿਲਾਂ 35 ਸਾਲ ਪਹਿਲਾਂ 35 ਸਾਲ ਪਹਿਲਾਂ
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: 33 ਸਾਲਾਂ ਦਾ ਸਮਾਂ
  • Sandbox: 33 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: 2024-05-06 12:37:36 (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 39 ਸਾਲ ਪਹਿਲਾਂ.

Sandbox

He has worked for FooBar Corp for the last 39 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