/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import java.util.*; import java.sql.Timestamp; fromCal = Calendar.getInstance(); fromCal.setTime(new java.util.Date()); fromCal.set(Calendar.DAY_OF_WEEK, fromCal.getActualMinimum(Calendar.DAY_OF_WEEK)); fromCal.set(Calendar.HOUR_OF_DAY, fromCal.getActualMinimum(Calendar.HOUR_OF_DAY)); fromCal.set(Calendar.MINUTE, fromCal.getActualMinimum(Calendar.MINUTE)); fromCal.set(Calendar.SECOND, fromCal.getActualMinimum(Calendar.SECOND)); fromTs = new Timestamp(fromCal.getTimeInMillis()); fromStr = fromTs.toString(); fromStr = fromStr.substring(0, fromStr.indexOf('.')); context.fromStr = fromStr; toCal = Calendar.getInstance(); toCal.setTime(new java.util.Date()); toCal.set(Calendar.DAY_OF_WEEK, toCal.getActualMaximum(Calendar.DAY_OF_WEEK)); toCal.set(Calendar.HOUR_OF_DAY, toCal.getActualMaximum(Calendar.HOUR_OF_DAY)); toCal.set(Calendar.MINUTE, toCal.getActualMaximum(Calendar.MINUTE)); toCal.set(Calendar.SECOND, toCal.getActualMaximum(Calendar.SECOND)); toTs = new Timestamp(toCal.getTimeInMillis()); toStr = toTs.toString(); toStr = toStr.substring(0, toStr.indexOf('.')); context.toStr = toStr;