Kevin Z
Kevin Z

Reputation: 341

Insert Current Date/Time into XML through Ruby Builder

I want to insert the current date/time into my xml feed using Rails Builder.

Here is what I am trying to get:

<?xml version="1.0" encoding="utf-8" ?>
<FirstObject timestamp="2002-06-01T07:00:00">
....

I have:

xml.instruct!
xml.FirstObject 
....

What is the command to put in the current date? Thanks!

Upvotes: 1

Views: 425

Answers (1)

pguardiario
pguardiario

Reputation: 55002

xml.FirstObject :timestamp => Time.now 

Upvotes: 1

Related Questions