When you are writing to the FIM WebService and setting datetime values; these values needs to be formatting a specific way, otherwise you gain a very descriptive (!) exception (UnvillingToPerformException).
The format is the ISO 8601 format: yyyy-MM-ddTHH:mm:ss.fff
So to write a datetime field in .NET; you use this syntax:
new CreateRequestParameter("ValidFromDate", DateTime.Now.ToUniveralTime().ToString("’yyyy'-'MM'-'dd'T'HH':'mm':'ss'.000'"))
That’s what it takes.
Note: It is always a good idea to convert datetime fields into UTC-time. The FIM Portal will handle the needed display conversion into desired display (using either the Portals or the Users TimeZoneConfiguration).
Update: It seems it’s sufficient to call .ToUniversalTime() to get the proper formatting? At least that what I’ve been having success with recently.