# Datebox initialization, dumb question

**URL:** <https://www.ruby-forum.com/t/datebox-initialization-dumb-question/71083>\
**Category:** Engines\
**Created:** [February 21, 2006, 12:25am UTC](https://www.ruby-forum.com/t/datebox-initialization-dumb-question/71083 "2006-02-21T00:25:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![afg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ecc23a/32.png) [@afg](https://www.ruby-forum.com/u/afg)\
**Post date:** [February 21, 2006, 12:25am UTC](https://www.ruby-forum.com/t/datebox-initialization-dumb-question/71083/1 "2006-02-21T00:25:07Z")

</div>

I’ve just been testing out the dateboxes I created Friday.

They seem to be working good except I had a couple I wanted to  
initialize with today’s date.

With the scaffold code it happened automatically.

With the datebox engine I’m having to do it manually.

I’m using ‘:date\_started =\> Time.now.strftime("%m/%d/%Y")’

Is there another preset variable floating around that would be cleaner?

## Greg

Greg F.  
The Norcross Group  
Forensics for the 21st Century

---

<div class="post-metadata">

**Author:** ![afg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ecc23a/32.png) [@afg](https://www.ruby-forum.com/u/afg)\
**Post date:** [February 21, 2006, 9:46am UTC](https://www.ruby-forum.com/t/datebox-initialization-dumb-question/71083/2 "2006-02-21T09:46:36Z")

</div>

Greg F. wrote:

> I’ve just been testing out the dateboxes I created Friday.
> 
> They seem to be working good except I had a couple I wanted to  
> initialize with today’s date.
> 
> With the scaffold code it happened automatically.
> 
> With the datebox engine I’m having to do it manually.
> 
> I’m using ‘:date\_started =\> Time.now.strftime("%m/%d/%Y")’
> 
> Is there another preset variable floating around that would be cleaner?

If it’s datetime:

:date\_started =\> Time.now()

If it’s date:

:dated\_started =\> Date.today()

---

<div class="post-metadata">

**Author:** ![afg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ecc23a/32.png) [@afg](https://www.ruby-forum.com/u/afg)\
**Post date:** [February 21, 2006, 6:38pm UTC](https://www.ruby-forum.com/t/datebox-initialization-dumb-question/71083/3 "2006-02-21T18:38:54Z")

</div>

On 2/21/06, Henning P. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I’m using ‘:date\_started =\> Time.now.strftime(“%m/%d/%Y”)’
> > 
> > Is there another preset variable floating around that would be cleaner?
> 
> If it’s datetime:
> 
> :date\_started =\> Time.now()
> 
> If it’s date:
> 
> :dated\_started =\> Date.today()

Thanks,

I saw the Date class in the ruby book, but not the today() method.

## Greg

Greg F.  
The Norcross Group  
Forensics for the 21st Century
