473,771 Members | 2,297 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Wrong Date DATE(CURRENT DATE - 1 DAY) DB2 Z/OS

2 New Member
Hello!

Last night a job to create a view using DATE(CURRENT DATE - 1 DAY) received the current days date instead the previous days date.

Any one know why/how this can happen?

The DATE(....) is a hold over from when they use a hard coded date.

Is that scalar function impacting the result?

The job ran at 18:00 hours but when we run the code now (noon time) we get yesterdays date, as expected.

Any ideas would be great! Needless to say our user is expect a solution and an explanation.
Apr 3 '08 #1
3 7906
docdiesel
297 Recognized Expert Contributor
Hi,

in which timezone is your machine placed in, and which timezone is it using? Could it be that it's using UTC (GMT) while its physical home is somewhere in the US? That would explain the 6 hours difference between today and tomorrow (or yesterday and today - that's relative).

Regards,

Bernd
Apr 3 '08 #2
lyndac
2 New Member
I'm so embarrassed to report - because it is a view every time you access it DB2 does the calculation - hence accessing today 4/3 gives you 4/2. You can't see what it did yesterday.

One of my co-workers won the Genius of the Day Award by pointing this out.
Apr 3 '08 #3
docdiesel
297 Recognized Expert Contributor
Well, then ...

send greetings to your Genius of the Day co-worker - he's welcome on bytes.com, too. The main thing is that the problem gets solved. Thanks for reporting!

Regards,

Bernd
Apr 4 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4155
by: Andrew DeFaria | last post by:
I have the following php code: function Today2SQLDatetime () { $today = date ("Y-m-d H:i:s"); print "date (\"Y-m-d H:i:s\") returned $today<br>"; return $today; return date ("Y-m-d H:i:s"); } // Today2SQLDatetime Most of the time this works just fine. For today, for example, it
5
2771
by: David Woodward | last post by:
When I do the following (the date represents 2/1/2004) getDay returns 1, and it should be returning 0. It's the only month for which we see this behavior. var oDate = new Date() oDate.setYear(2004) oDate.setMonth(1) oDate.setDate(1) iDay = oDate.getDay()
7
2174
by: Esa | last post by:
function Validaattori_1viikko(source,args) { var star_tdate; var end_date; start_date = document.all("Laina_alku").value; end_date = document.all("Laina_loppu").value; var start_day; var end_day; var start_month; var end_month;
1
2341
by: Juan Romero | last post by:
Guys, I am reading file information from disk using the System.IO.File object. This is what the operating system is displaying on Explorer: File Name Modified ==================================== File1.ext 6/19/2003 1:05 PM File2.ext 6/14/2000 12:46 PM
0
1488
by: Howard Hinnant | last post by:
I'm tossing my date class into the public domain because I'm tired of it sitting around gathering dust. It was first created over a decade ago and has been evolving by bits and pieces since then. Here is the doc with the source+test linked off of it: http://home.twcny.rr.com/hinnant/cpp_extensions/Gregorian_date.html It has a relatively small footprint (2 words typical). It has a cute construction interface that makes it very...
30
5717
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the database I have a table with Date/time column. The database is located on a machine that is set to dd/mm/yyyy also. When I enter date 7/1/08 (as in January 7, 2008), it stores it in the database as 1/7/08 instead of 7/1/08. Why is it like that...
16
4461
by: W. eWatson | last post by:
Are there some date and time comparison functions that would compare, say, Is 10/05/05 later than 09/22/02? (or 02/09/22 format, yy/mm/dd) Is 02/11/07 the same as 02/11/07? Is 14:05:18 after 22:02:51? (24 hour day is fine) How about the date after 02/28/04 is 02/29/04, or the date after 09/30/08 is 10/01/08?
2
1695
by: =?Utf-8?B?QW5keQ==?= | last post by:
Hello, Today is Thursday. However Now.day and day(now) are retutning 6, which equates to DayOfWeek.Saturday. This is causing havoc here as the system currently thinks the offices are shut, casing lots of issues. Does anybody have any ideas what's happenning?
0
2123
by: sumansms | last post by:
Hi All, I am getting wrong date when I am using DateTime.Parse function. The following is the code.. DateValue = DateTime.Parse(datarow.ToString()).ToString("MM/dd/yyyy"); I am taking the data from a proc keeping it in a datarow. While displaying the value I am getting the date value one less then it is in the DB. e.g. 3/31/2010 values comes as 3/30/2010 (for some timezone). This is a code written by someone else so basically I need to...
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9910
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.