added date and time pattern and from index option to indexof