Re: [xwiki-users] help needed to show data in a different timezone

2015-09-03 Thread [IDIS Technical Secretariat] Ricardo Rodríguez
I reply myself for completeness...

On Mon, Aug 31, 2015 at 2:46 PM, [IDIS Technical Secretariat] Ricardo
Rodríguez  wrote:

> Hi!
>
> The server where our XWiki 7.1.2. installation is running is in CEST
> timezone. We do need to read dates in GMT timezone and find this...
>
> How can I format a date in a different time zone in Velocity Template
> using DateTool?
>
> http://stackoverflow.com/questions/21691445/how-can-i-format-a-date-in-a-different-time-zone-in-velocity-template-using-date
>
> I'm not able to get this running. Please, could somebody provide an
> example of using or any other way to transform the date to GMT?
>
>
In the same XWiki page I can use Groovy to instantiate TimeZone and get a
TimeZone object with the desired value...

{{groovy}}
xcontext.put("sTimezone", java.util.TimeZone.getTimeZone("GMT"))
{{/groovy}}

Also, complete the Velocity script to add a variable to store my locale...

{{velocity}}
#set($sLocale = $datetool.getLocale())
...
{{/velocity}}

Then, I call it from Velocity...

{{velocity}}
...
#set($date = $datetool.format('d MMM  hh:mm:ss z', $rcDoc.date,
$sLocale, $xcontext.sTimezone))
...
{{/velocity}}

I'll add this comments to the concerned Timeline Extension page in xwiki.org.
Here there is an example running in our own server...

http://portal.idisantiago.es/xwiki/bin/view/Home/Timeline

Any comment will be extremely welcome! Thanks!

Cheers,

Ricardo



> Thank you for your help!
>
> Ricardo
>
> --
> Ricardo Rodríguez
> Research Management and Promotion Technician
> Technical Secretariat
> Health Research Institute of Santiago de Compostela (IDIS)
> http://www.idisantiago.es
>



-- 
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] help needed to show data in a different timezone

2015-08-31 Thread [IDIS Technical Secretariat] Ricardo Rodríguez
Hi!

The server where our XWiki 7.1.2. installation is running is in CEST
timezone. We do need to read dates in GMT timezone and find this...

How can I format a date in a different time zone in Velocity Template using
DateTool?
http://stackoverflow.com/questions/21691445/how-can-i-format-a-date-in-a-different-time-zone-in-velocity-template-using-date

I'm not able to get this running. Please, could somebody provide an example
of using or any other way to transform the date to GMT?

Thank you for your help!

Ricardo

-- 
Ricardo Rodríguez
Research Management and Promotion Technician
Technical Secretariat
Health Research Institute of Santiago de Compostela (IDIS)
http://www.idisantiago.es
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users