Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Search&Promote: how do I change the format of dates in results?

alexander_santo
Level 1
Level 1

In Search&Promote I am creating a Date field with "Monday, 24. May 2013 06:30 PST", and I would like to have it displayed as May/24/2013". How can I do that?

 

Thanks.

1 Accepted Solution
vlad_green
Correct answer by
Level 1
Level 1

This topic requires some explanation:

  1. Getting the date into the index
  1. The field must the “date” type.
  2. Once you get the Date data in the field you can do whatever you want with it: change format, change time zone (consistently), etc.
  3. For this you need to create a specific mask in the field what will receive the data/time data. You can have multiple masks for the date/time you are getting.
  4. If you do not have a right mask to ingest the data into the field the crawler will complain and will report it as an error in the index log.
  5. By default all dates and times are stored in the index using the time zone set for the index. (Settings > Accounts Options > Account Settings > Time Zone)
  • if your index is Germany time zone, and the time saved is “11:01:00 PM”, it will be saved as 11:01:00 PM Germany time. This unless you specify a different time zone in the field definition (at the bottom).
  • [img]date_field.png[/img]
  1. Getting the date out of the index
  1. If the data for date/time was saved successfully in the index now you just need to recover it in the transport layer, where you can format it.
  2. This is how you call the date field in the transport layer: <search-display-field name="field-name" date-format="date-format-string" />
  3. The date formatting is explained here: https://microsite.omniture.com/t2/help/en_US/snp/8.10.1/r_Date_Formats.html#reference_4D1FC1F6B9F448...
  • For your case it should be: %d.%m.%y (day.month.year)

 

Regards,


Vlad

View solution in original post

1 Reply
vlad_green
Correct answer by
Level 1
Level 1

This topic requires some explanation:

  1. Getting the date into the index
  1. The field must the “date” type.
  2. Once you get the Date data in the field you can do whatever you want with it: change format, change time zone (consistently), etc.
  3. For this you need to create a specific mask in the field what will receive the data/time data. You can have multiple masks for the date/time you are getting.
  4. If you do not have a right mask to ingest the data into the field the crawler will complain and will report it as an error in the index log.
  5. By default all dates and times are stored in the index using the time zone set for the index. (Settings > Accounts Options > Account Settings > Time Zone)
  • if your index is Germany time zone, and the time saved is “11:01:00 PM”, it will be saved as 11:01:00 PM Germany time. This unless you specify a different time zone in the field definition (at the bottom).
  • [img]date_field.png[/img]
  1. Getting the date out of the index
  1. If the data for date/time was saved successfully in the index now you just need to recover it in the transport layer, where you can format it.
  2. This is how you call the date field in the transport layer: <search-display-field name="field-name" date-format="date-format-string" />
  3. The date formatting is explained here: https://microsite.omniture.com/t2/help/en_US/snp/8.10.1/r_Date_Formats.html#reference_4D1FC1F6B9F448...
  • For your case it should be: %d.%m.%y (day.month.year)

 

Regards,


Vlad

View solution in original post