# Time.now and System::Text::EncoderFallbackException

**URL:** <https://www.ruby-forum.com/t/time-now-and-system-encoderfallbackexception/174087>\
**Category:** IronRuby\
**Created:** [August 20, 2009, 5:48pm UTC](https://www.ruby-forum.com/t/time-now-and-system-encoderfallbackexception/174087 "2009-08-20T17:48:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![maslov](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@maslov](https://www.ruby-forum.com/u/maslov)\
**Post date:** [August 20, 2009, 5:48pm UTC](https://www.ruby-forum.com/t/time-now-and-system-encoderfallbackexception/174087/1 "2009-08-20T17:48:48Z")

</div>

Hi all,

I’ve got a strange problem with Time.now (and System.DateTime.Now, of  
course) when the current culture is set to ‘ru-RU’, ‘pl-PL’ or some  
other cultures:

V:\PROGS\Ruby\Migrate\ClearQuest\>D:\Progs\Ruby\IronRuby-0.9.0\bin\ir.exe  
IronRuby 0.9.0.0 on .NET 2.0.50727.3082  
Copyright © Microsoft Corporation. All rights reserved.

> > > include System::Globalization  
> > > =\> Object
> 
> > > include System::Threading  
> > > =\> Object
> 
> > > Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(‘ru-  
> > > RU’)  
> > > =\> ru-RU
> 
> > > Time.now  
> > > =\> mscorlib:0:in `GetBytes': Value does not fall within the expected range. (Sys tem::Text::EncoderFallbackException) from mscorlib:0:in`GetBytes’  
> > > from :0

Can anybody help?

Thanks,  
Maxim Maslov
