Dossie
Dossie

Reputation: 57

Sitecore webforms for marketers datetime issues

We are in the process of upgrading sitecore from 6.5 tot 7.2, and the webforms for marketers module from 2.3 to 2.4

If I submit a form, for example on 0900, log in to the sitecore admin, and open the Forms Report, everything is inserted correctly, except for the "Created" field, which shows the time plus 2 hours -> 1100

If I navigate the sqlite database using SQLite Manager (a firefox plugin) I see that the Timestamp column on the Form table shows the time minus 2 hours -> 0700

The code is in the sitecore.Forms.Core .dll, which I cant debug because I dont have a .pdb file. I`ve looked into the Sitecore.Forms.Config file if I should add some cultureinfo, but cant find anything

Datetime.Now gives the correct datetime if I render it on a page, and if I create items in the sitecore admin, the right dates are inserted.

Does anyone know how this can happen?

Upvotes: 0

Views: 380

Answers (2)

Ian Graham
Ian Graham

Reputation: 3216

I would recommend switching to a SQL database for Web Forms for Marketers on version 2.4 for a more reliable platform- as you are upgrading it seems like the right point to do this.

The database files you need are in the / data (mdf and ldf)folder when you download wffm here:

http://sdn.sitecore.net/SDN5/Resources/Sitecore%207/Web%20Forms%20for%20Marketers%20Module/Web%20Forms%20for%20Marketers%202.4.aspx

If you want to migrate your data there's a good post here on how to do that

http://blog.computol.com/post/29404213349/sitecore-web-forms-for-marketers-migrating-from

Upvotes: 0

Jan Bluemink
Jan Bluemink

Reputation: 3487

This is correct. It is a SQL Server Timestamp field. Returns the current database system timestamp as a datetime value without the database time zone offset.

You can use Something like this to dispay the local time:

SELECT TOP 10 [Id]
      ,[FormItemId]
      ,[SessionId]
      ,[StorageName]
      ,[Timestamp]
      ,[Data]
      ,CONVERT(datetime, SWITCHOFFSET(CONVERT(datetimeoffset, Timestamp), DATENAME(TzOffset, SYSDATETIMEOFFSET()))) AS LocalDateTime
  FROM [Sitecore_WebForms].[dbo].[Form] order by TimeStamp desc

If you go In Sitecore to the Web Forms For Marketeers / Form Reports than you can create a .xls in this Excel export you see the correct time.

If you want to see the code inside sitecore.Forms.Core.dll you can useJetBrains dotPeek a Free .NET decompiler.

Upvotes: 0

Related Questions