how to change the format of solr last index - mongodb

I want to perform delta import fro that I need to compare my update date with Solr's last_index_time. so I have a problem to compare to two different format my format of update date is 2019-01-29T05:06:02.192Z But Solr last_index_Time format is 2019-01-30 10:07:58, So, I want to change my solr last_index_time format in my object Date format. Can anyone help me for that?

Generally, propertyWriter is used to change last_index_time format in SOLR (SOLR-2658)
<propertyWriter dateFormat="yyyy-MM-dd'T'HH:mm:ss.SSSXXX" type="SimplePropertiesWriter" filename="dataimport.properties" locale="en_US"/>
Note: Additionally, this adds a <propertyWriter /> element to DIH's data-config.xml file, allowing the user to specify the location, filename and Locale for the "data-config.properties" file.

Related

Date and Time Validation Checking in freemarker

I would like to check the given date and time against the following formats.
Date -- {YYYYMMDD},
Time need to check with four formats -- {HHMM, or HHMMSS, or HHMMSSD, or HHMMSSDD}
Above date and time formats needs to be checked using freemarker,
How to check and validate in freemarker? ..
Please suggest
Validation (like input validation) is normally not done in templates. So if you parse strings with ?date(pattern)/?time(pattern), and the format doesn't match, the whole template terminates with error. If you just need to figure out which of those formats a string input is in, you could use the length (?length) and/or regular expressions (?matches(regexp)).

importing a text file in Access?

I have a large text file containing 4 attributes, I want to import this file in Microsoft access 2013 , but when the data is imported it gives an error
Type Conversion Failure
This error is occurring on Date Time field
The format of Date and Time is like that:
2008-02-02 15:36:08
Here is the sample of the file:
Sample of data
I guess you might have skipped explicitly defining the date format during the import procedure.
During the import process you need to click on advanced. This menu should appear:
you want to make sure that the highlighted fields match the date format in the text file.
EDIT: you will also want to make sure that the field is imported as Data Type Date Time

Can Pandas (or Python) recognize today's date?

I was wondering if Pandas can somehow figure out what today's date is allowing me to automate the naming of the html file I create when I use the "df.to_html" method.
Basically I"m trying to read a website using method "pd.read_html", and then save the dataframe as an html file, daily. The name of the html file will be the day's date. (So today is 9/28/2016 and tomorrow will be 10/01/16 and so on ) I'm not particular about the format of the date, so Sept or 09, whichever is okay.
I'm trying to automate this as much as possible, and so far the best I've gotten is, using ".format" which allows me some flexiblity. But I don't know how I can further automate the process.
import pandas as pd
df = pd.read_html('random site')
today_date = 'saved data/{}.html'.format('Sept 28') # I'm saving it in the folder "saved data" with the name as today's date.html.
df.to_html(today_date)
Thanks.
See the datetime module.
specifically: datetime.date.today().isoformat() gives you a string with the current date in ISO 8601 format (‘YYYY-MM-DD’)

What format is required to import a date into google spreadsheet

With the help of "stackoverflow" and it's users I'm using an app to import data into a Google spreadsheet. The problem is I have a date question on the form, and can not manage to import it. If I change the format (in the forms) to text, the data imports as it has been sent from the app, but when I change it back to date, nothing.
I've believe I've tried all the usual date formats (dd/mm/yyyy, mm/dd/yyyy, yyyy/mm/dd, yyyy/dd/mm) as well as yy for the above and also numerical.
I know that the Google form shows the date in the users format and that is not a problem. It shows up correctly in the spreadsheet in my local format (dd/mm/yyyy).
Does anyone know what format the form uses to send the data to the spreadsheet, or anyway to find out.
Thanks in advance.
Ok, after using wikipedia, and trying every different format it works by using the format yyyy-mm-dd

Yii global date format (l18n)

When I type:
Yii::app()->getLocale()->dateFormat
it gives me the correct dateformat for the current set language. (in my example it is 'de' => dd.MM.yyyy). But when I type:
Yii::app()->format->dateFormat
Yii gives me the date format for 'en_us' (Y/m/d).
With getLocale() I will get only the string saved in i18n file. In ->format->date() this format string should be used, but I don't find a way to assign the i18n string to the CDateFormatter or CFormatter Object.
The CFormatter component accessed with Yii::app()->format is not meant to be used for localization out of the box; it does not automatically work according to the application locale.
You could manually change the relevant properties on Yii::app()->format to bring it in line with the application locale, but there is a more convenient way to format dates:
Yii::app()->locale->dateFormatter->formatDateTime(...)
See CDateFormatter::formatDateTime for more information; if you want more control, there are other methods such as CDateFormatter::format available. Also keep in mind that CLocale::getNumberFormatter() is available to format numbers.