Error in cfqueryparam, when obtaining field date the cfpop

Hi all
I take the data of the cfpop to store them in the database. There are problems with date data:

INSERT...
POST_DATE = < cfqueryparam value = "" #date # "cfsqltype ="cf_sql_timestamp">"

But it will fail in some situations, for example:

The cause of this output exception was that: coldfusion.runtime.locale.CFLocaleBase$ InvalidDateTimeException: '19 Sep 2006 00:51:33 ' + 0200 is an invalid date or time string

OK, I'm using the English locale and tried to use ParseDateTime (date, "pop"). But that doesn't work either (!):

'19 sep 2006 00:51:33 ' + 0200 isn't a valid date format. But guess 'pop', it comes with zone offset format!

PS The problem was that some of the emails had incorrect date format: it had no a week day, another - same day of the month!

To make life simpler, I just added a control of regexp:

< cfif ReFindNoCase ("[A - z] {3} \,\s [0-9] {2} \s [A - z] {3} \s [0-9] {2,4} \s [0-9] {2}: [0-9] {2}: [0-9] {2} \s (?:------+ |)") \-) ? [0-9] {4} "(, ce jour, 0) >"
< cfset dateField = date >
< cfelse >
< cfset dateField = now() >
< / cfif >

I'm not going to analyze each possible date format error.

Hi all
I take the data of the cfpop to store them in the database. There are problems with date data:

INSERT...
POST_DATE =

But it will fail in some situations, for example:

The cause of this output exception was that: coldfusion.runtime.locale.CFLocaleBase$ InvalidDateTimeException: '19 Sep 2006 00:51:33 ' + 0200 is an invalid date or time string

OK, I'm using the English locale and tried to use ParseDateTime (date, "pop"). But that doesn't work either (!):

'19 sep 2006 00:51:33 ' + 0200 isn't a valid date format. But guess 'pop', it comes with zone offset format!

PS The problem was that some of the emails had incorrect date format: it had no a week day, another - same day of the month!

To make life simpler, I just added a control of regexp:





I'm not going to analyze each possible date format error.

Tags: ColdFusion

Similar Questions

  • A transport-level error has occurred when receiving results from the server. (provider: TCP provider, error: 0 - the semaphore timeout period has expired.)

    Hello

    I get the below error message while my windows application inserts data in SQL Server.

    A transport-level error has occurred when receiving results from the server. (provider: TCP provider, error: 0 - the semaphore timeout period has expired.)

    I use LINQ-to-SQL.  SQL Server is installed on Windows server 2003.

    We are using SQL server 2008 r2.

    When we insert large data base records, approximately 1 million we get this question.

    Please suggest.

    Hello

    When you use Windows server, we ask you to send the query in the link depending on whether they are the experts.

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?category=WindowsServer

    Thank you.

  • Error code: 0x8007045D when transferring files to the card reader.

    Original title: Error code: 0x8007045D

    Error code: 0x8007045D when transferring files to the card reader. Lost files. Running Windows 7.

    Hi Bernard Major,.

    1 did you change the permission for the files you are trying to copy?

    2. What place you are trying to copy the files?

    3. are you able to copy the same files on another computer?

    You can try to copy files to another location on the computer and check.

    Step 1:

    I recommend you to check if you have enough permission on the card reader to transfer files.

    See the link to apply authorization:

    What to know before applying permissions to a file or folder

    http://Windows.Microsoft.com/en-us/Windows7/what-to-know-before-applying-permissions-to-a-file-or-folder

    Step 2:

    If you're still having problems, then run Check disk to repair the bad sectors.

    a. Click Start, in the start search bar type cmd, right-click on the command prompt icon in the box programs and then click Run as administrator.

    b. Type X: (for the card reader drive letter) and press enter

    c. at the command prompt, type chkdsk /f and then press ENTER.

    Now, type chkdsk/r

    Note: CHKDSK would attempt to recover bad sectors on the hard disk, in the course of this process there are chances of DATA loss from that particular area. You can save the data on the disk before you perform a checkdisk.

    For more information, refer to the article below.

    Error message when you try to perform a full backup on a Windows Vista-based computer: "the application cannot be performed because of an i/o device error."

    http://support.Microsoft.com/kb/952272

    Note: This article remains valid for Windows 7 also.

    I also suggest you to check this problem with another USB plug.

    Hope this information is useful.

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • I get this error code 80070020 when trying to update the KB3035132

    * Original title: HELP

    I get this error code 80070020 when trying to update the KB3035132, I did all the suggestions and get the same thing.

    What to do from here

    http://Windows.Microsoft.com/en-AU/Windows/Windows-Update-Error-80070020#1TC=Windows-Vista
    If you receive Error 80070020 Windows Update, this could mean a program running on your computer is interfering with Windows Update. It is often a simple synchronization problem, and it can be solved by restarting your computer and then run Windows Update again.
    See also: http://support2.microsoft.com/kb/883825

  • Receive the error code: 1606 when trying to install the program

    I received an Error 1606 times before and went through the process of editing the registry, and it solved the problem I had.  However, now when I try to install the 2008 edition of turbo tax I get a different error message 1606.  But when I go into the registry, all entries are fine, they harmonize perfectly with the entries in the table provided by Microsoft.

    How can I solve this problem, if solutions are not even necessary?

    It's the exact error message I receive:

    ApplicationController: MSI install Exception occurred: Microsoft Installer error: 1606, with error code: 1606

    Hi Kisuru,

    1 - is the first time that you install Turbo tax on the computer?
    2 are you able to install other programs on the computer?

    By searching on the site of TurboTax, I found a solution for the error message that you have already tried as you mentioned.

    Error 1606: Could not access network location
    http://TurboTax.Intuit.com/support/kb/installing/errors/7164.html

    I suggest that you download and install the utility windows install cleanup then start the cleaning utility in the start menu and then to delete the entries for the software, and then restart the computer for the changes to take effect and now try to reinstall the software and check.

    Description of the Windows Installer Cleanup utility
    http://download.Microsoft.com/download/e/9/d/e9d80355-7ab4-45b8-80e8-983a48d5e1bd/msicuu2.exe

    For extra support try posting your query in the community forums Turbo tax.
    https://TtlC.Intuit.com/app/full_page

    I hope this helps!

    Halima S - Microsoft technical support.
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Receive the error code: 1606 when trying to install the program, normal solutions do not apply.

    I received an Error 1606 times before and went through the process of editing the registry, and it solved the problem I had.  However, now when I try to install the 2008 edition of turbo tax I get a different error message 1606.  But when I go into the registry, all entries are fine, they harmonize perfectly with the entries in the table provided by Microsoft.

    How can I solve this problem, if solutions are not even necessary?

    It's the exact error message I receive:

    ApplicationController: MSI install Exception occurred: Microsoft Installer error: 1606, with error code: 1606

    This is the recovery and repair of Vista Forum.

    http://social.answers.Microsoft.com/forums/en-us/vistaprograms/threads

    They will help you with your question when you repost in the Forum programs Vista at the above address.

    See you soon.

    Mick Murphy - Microsoft partner

  • Lightroom 4: cannot change to slide show Module - Get error has occurred when attempting to change the module

    I have a new MacMini (2 months) with OSX 10.8.2 and 16 GB of ram. I had a partial re - installed, bringing more of my settings from my old computer (a MacBook Pro, 10.8.2)

    4.3 Lightroom worked very well until I went to use the slideshow module.  I received an error message and the library module does not open.  Read the message "an error has occurred when attempting to change modules.

    What can I do to fix this?

    Here's what I've done so far:

    1. checekd the disk permissions and disk status - all ok
    2. check the integrity of my catalogs and saved them - all ok
    3. moved files preferably, ending with 'plist' from the root and user libraries - no change
    4. only moved to the folder of the user, to support / library/application - no change
    5. Checked and opened upward "privileges" on the files for the library files and the catalog files.  Checked 'apply to all files' - no change
    6. contacted one and Nik to see if they had heard of this problem - no, they didn't and don't think their programs could be the cause of this problem
    7. Contact Adobe - level 1 support - crossed some of the points above - no effect

    I am waiting for a call from level 2 return to Adobe.  In the meantime, one has this problem or have any other suggestions.  The only alternative I have is to completely uninstall Lr and start again.  But it's a bit drastic.

    Thank you

    This is a bug, usually related to having a second monitor attached.

    Roll to 4.2 from here: http://www.adobe.com/support/downloads/detail.jsp?ftpID=5487 - simply drag 4.3 to the trash, and run this installer.

  • Error 0xC00D2781 when obtaining security for the Overdrive Media Console software update

    When getting to a security update for the error code of Overdrive Media Console get 0xC00D2781.  I tried to update by going to tools in the Overdrive Media Console software and also by going to the link http://drmlicense.one.microsoft.com/indivsite.

    I found my answers in this forum. I had to change the DRM to DRM.old folder and reopen the media player and then it worked :) Good luck

  • Error SQL Loader loading a field date

    Hello

    I get the error while I'm trying to load a table with a field of date using SQL Loader below

    Sheet 1: Rejected - error on the table RPT_HOST_USAGE, column USAGE_TIMESTAMP.
    ORA-01861: literal does not match the format string


    My input file is as below
    < code >
    Host_Usage_ID, Host_ID, Technology_ID, Environment_ID, Usage_Timestamp, Avg_CPU_Pct, Avg_Memory_MB, CPU_Spike
    1,12,1,8,'2009-08-01 00:00:00 ', 0.000000000, 23875.000000000, 0.000000000
    < code >

    My Loader.ctl is
    < code >
    OPTIONS (SKIP = 1)
    load data
    INFILE 'C:\rpt_Host_Usage.txt '.
    in the RPT_HOST_USAGE table
    fields completed by «,»
    (
    HOST_USAGE_ID,
    HOST_ID,
    TECHNOLOGY_ID,
    ENVIRONMENT_ID,
    USAGE_TIMESTAMP,
    AVG_CPU_PCT,
    AVG_MEMORY_MB,
    CPU_SPIKE
    )
    < code >

    I tried options like USAGE_TIMESTAMP TO_DATE(USAGE_TIMESTAMP,'YYYY-MM-DD HH24:MI:SS') but did not...
    Can you please tell me how to fix this?

    Pointers on it will be useful

    Thank you

    Mahesh

    I went back and looked at some of my old files of *.ctl and I did something simlilar to what you mentioned and it worked for me, but I was surrounded by the quotes option and included a colon in front of the element. Example:

    ...
    TECHNOLOGY_ID,
    ENVIRONMENT_ID,
    USAGE_TIMESTAMP ' to_date (: USAGE_TIMESTAMP, "YYYY-MM-DD HH24:MI:SS)."
    AVG_CPU_PCT,
    AVG_MEMORY_MB,
    ....

  • Get error - "Fatal error during installation" when trying to remove the software

    When I try to remove a software via Add/Remove programs in Control Panel, I get this error message "Fatal error during installation" and I'm not able to remove this program. Help, please.

    Hello epsita esha.

    You can try to use the automated Microsoft FixIt to uninstall programs. You can choose the program you want to uninstall.

    Diagnose and solve the program installation and uninstallation problems automatically
    http://support.Microsoft.com/mats/Program_Install_and_Uninstall

    I hope this helps.

  • Error 66 has, when trying to install the update to windows

    Original title: I'm trying to update my windows through windows update but it keeps failing and saying found error code 66A

    cannot fix the windows update

    I'm trying to update my windows through windows update but it keeps failing and saying error found code 66A (unknown error) and then I went to fix with windows repair and he says its fixed, but now it used to always update the same said just only he thinks its fixed Please help!

    Hello

    Did you make any changes before the show?

    You can read the following article and check.

    Codes error '0x8007066A' or '66' was to occur when you install updates of .NET Framework

    http://support.Microsoft.com/kb/2507641/en-us

    It will be useful.

  • Error message appears when you click on the start menu.

    Original title: I can't go to the "Start" menu on my Toshiba laptop.

    I can't go to the "Start" menu on my Toshiba laptop. A msg of error appears and I can't do anything else with it. I tried F8 this screen appears. When I select one of the choices, they all return to the error msg... Help, please

    Hello

    display error message

    How to ask a question

    http://support.Microsoft.com/kb/555375

    -What you trying to do?
    -Why are you trying to do?
    -Do you try already, why and what was the outcome of your actions?
    - , What was the exact error message you received?
    -How long have you been experiencing this problem?
    -Have you searched the relevant forum/newsgroup archives?
    -Have you tried all the tools or KB articles or other resources?
    -Have you recently installed or uninstalled any hardware or software?
    -What changes have been made to the system between the time where everything has worked, and when you noticed the problem?

  • CSCsk88503 - wrong Error Message displayed when adding duplicate of the political credentials.

    When I go to add the AXLuserGroup in the CUCM 9.0 to integrated with Cisco Unified IM and presence I don't fund our LDAP SYCN device associated with user and when I save with error below:

    Error: [2254] IMS_808

    Can you help me?

    I have the same error after I upgraded to 9.1.2 and tried to add users. How do solve you the problem?

    Thank you

  • Error code: 0xC004F074, when you click on the key button enable

    Original title: Windows key error

    one day, I received this watermark on the bottom right of my pc (im running windows 8) and I tried to activate my key. I don't see the reason why I have to once again, since I already did once (obviously) and I get this error code: 0xC004F074. I have no idea what to do, and when I do not click on the "button"Turn the key"blue circle loading that appears responsible for less then half a second.

    Press the Windows key + X , then clickrun, then type: slui.exe 4

    2. then press the ENTER"" key.

    3. Select your "country" in the list.

    4. choose the option "activate phone".

    5. stay on the phone (do not select/press all options) and wait for a person to help you with the activation.

    6. explain your problem clearly to the support person.

  • Suddenly cannot send email, I get error message saying: an error has occurred when sending mail. The mail server responded: authentication is required before to

    Thunderbird has worked perfectly on 9/3. This morning all of a sudden I can't send e-mail. The message is: an error occurred while sending mail. The mail server responded: authentication is needed before sending it [R0107005]. Please make sure that your e-mail address is correct in your e-mail preferences and try again.

    I made no changes between 9/3 and 9/4

    any help appreciated, have been using Thunderbird for many years.

    Jerry

    problem solved. a message to update thunderbird stood, updated and now works. WOW!

Maybe you are looking for

  • OSX stuck somewhere between Yosemite &amp; El Capitan

    So, I tried to upgrade to El Capitan and my iMac has hung up, had to close.  Gets blocked early in the process and crashes, read many posts on this. Off, I could not boot normally, because it would not see the operating system and try to install El C

  • Equium M50 can burn CD but not DVD - power calibration error

    Hello Well, basically, that's my problem. The other day I tried to burn a dvd but kept getting the "power calibration error" tried different DVD and burning software, but still the same problem, although I can burn DVDs perfectly. Any ideas anyone?Th

  • HP PAVILION 15 laptop PC: failed upgrade of Windows 10

    I have upgraded to windows 10 today. Everything is going well until I reached the microsft login screen. Connection has been accepted, but I was mounted directly in a naked desktop computer and the screen flashes and goes off every second or two. I t

  • Vision acquisition software lisence problem?

    Hello, everyone I have LabVIEW 2009 with the kit of development of all theI programmed an application (I use IMAQdx for this application), then I create application ((application EXE, puis je construire installateur pour cette application)). I take t

  • MaxPageSize problem/Question about Active Directory in my organization.

    Hello guys, I'm having a weird problem with Active Directory in my organization. Long story short: In my environment, the MaxPageSize value is the default value (1000), and MaxValRange also has by default (1500). However, in the Exchange Event Viewer