Time

Version 15 (nimetu, 12/19/2013 08:18 am)

1 9 vl
h1. Time
2 1 vl
3 10 vl
This Ryzom API gets the time in the game servers (shards).
4 9 vl
5 1 vl
h2. Base URL
6 1 vl
7 13 kervala
* http://api.ryzom.com/time.php
8 6 vl
9 9 vl
h2. URL Parameters
10 1 vl
11 1 vl
h3. @format@ (optional) 
12 1 vl
13 1 vl
Default @format@ is @raw@.
14 1 vl
15 13 kervala
* @raw@: Returns the tick. The server tick is a 32 bit integer that increases by one every 100 milliseconds ("example":http://api.ryzom.com/time.php?format=raw).
16 14 kervala
* @txt@: Returns a homine-readable string ("example":http://api.ryzom.com/time.php?format=txt).
17 14 kervala
* @xml@: Returns an xml file that contains all shard time information ("example":http://api.ryzom.com/time.php?format=xml).
18 9 vl
19 1 vl
h2. Cache Duration
20 1 vl
21 1 vl
The data is cached during *1 minute*.
22 1 vl
23 9 vl
h2. PHP Interface
24 1 vl
25 15 nimetu
h3. @ryzom_time_api()@
26 9 vl
27 15 nimetu
Returns *SimpleXMLElement* or boolean *false* on failure.
28 1 vl
29 15 nimetu
h3. XML structure
30 1 vl
31 15 nimetu
<pre><code class="xml">
32 15 nimetu
<shard_time>
33 15 nimetu
  <server_tick>514105152</server_tick>
34 15 nimetu
  <jena_year>2576</jena_year>
35 15 nimetu
  <day_of_jy>319</day_of_jy>
36 15 nimetu
  <month_of_jy>10</month_of_jy>
37 15 nimetu
  <cycle>0</cycle>
38 15 nimetu
  <day_of_cycle>319</day_of_cycle>
39 15 nimetu
  <month_of_cycle>10</month_of_cycle>
40 15 nimetu
  <day_of_month>19</day_of_month>
41 15 nimetu
  <day_of_week>1</day_of_week>
42 15 nimetu
  <season>3</season>
43 15 nimetu
  <day_of_season>49</day_of_season>
44 15 nimetu
  <time_of_day>13</time_of_day>
45 15 nimetu
  <txt_en>13h - Dua, Mystia 20, 1st AC 2576</txt_en>
46 15 nimetu
  <txt_fr>13h - Dua, Mystia 20, 1er CA 2576</txt_fr>
47 15 nimetu
  <txt_de>13h - Dua, Mystia 20, 1. AZ 2576</txt_de>
48 15 nimetu
  <cache created="1387437183" expire="1387437243"/>
49 15 nimetu
</shard_time>
50 15 nimetu
</code></pre>
51 9 vl
52 9 vl
h2. Real Examples
53 1 vl
54 1 vl
If you have a website that use this Ryzom API, tell it in the forum and we'll add it.
55 9 vl
56 12 vl
* Unversal Widget (for windows, netvibes, igoogle,...) http://eco.netvibes.com/widgets/305491/ryzom-time
57 13 kervala
* Atys Time converter (sources available) http://ryzom.kervala.net/time.php