pdf viewer for asp.net web application : Add multiple jpg to pdf SDK application API .net azure asp.net sharepoint postgresql-9.4-A429-part2934

Chapter 9. Functions and Operators
Function
Return Type
Description
Example
Result
clock_timestamp()
timestamp
with time
zone
Current date and
time (changes
during statement
execution); see
Section 9.9.4
current_date
date
Current date; see
Section 9.9.4
current_time
time with
time zone
Current time of
day; see Section
9.9.4
current_timestamp
timestamp
with time
zone
Current date and
time (start of
current
transaction); see
Section 9.9.4
date_part(
text
,
timestamp
)
double
precision
Get subfield
(equivalent to
extract
); see
Section 9.9.1
date_part(’hour’,
timestamp
’2001-02-16
20:38:40’)
20
date_part(
text
,
interval
)
double
precision
Get subfield
(equivalent to
extract
); see
Section 9.9.1
date_part(’month’,
interval ’2
years 3
months’)
3
date_trunc(
text
,
timestamp
)
timestamp
Truncate to
specified
precision; see also
Section 9.9.2
date_trunc(’hour’,
timestamp
’2001-02-16
20:38:40’)
2001-02-16
20:00:00
date_trunc(
text
,
interval
)
interval
Truncate to
specified
precision; see also
Section 9.9.2
date_trunc(’hour’,
interval ’2
days 3 hours
40 minutes’)
2 days
03:00:00
extract
(
field
from
timestamp
)
double
precision
Get subfield; see
Section 9.9.1
extract(hour
from
timestamp
’2001-02-16
20:38:40’)
20
extract
(
field
from
interval
)
double
precision
Get subfield; see
Section 9.9.1
extract(month
from interval
’2 years 3
months’)
3
isfinite(
date
)
boolean
Test for finite date
(not +/-infinity)
isfinite(date
’2001-02-16’)
true
isfinite(
timestamp
)
boolean
Test for finite time
stamp (not
+/-infinity)
isfinite(timestamp
’2001-02-16
21:28:30’)
true
isfinite(
interval
)
boolean
Test for finite
interval
isfinite(interval
’4 hours’)
true
218
Add multiple jpg to pdf - insert images into PDF in C#.net, ASP.NET, MVC, Ajax, WinForms, WPF
Sample C# code to add image, picture, logo or digital photo into PDF document page using PDF page editor control
add jpg to pdf file; how to add image to pdf in acrobat
Add multiple jpg to pdf - VB.NET PDF insert image library: insert images into PDF in vb.net, ASP.NET, MVC, Ajax, WinForms, WPF
Guide VB.NET Programmers How to Add Images in PDF Document
how to add image to pdf acrobat; add multiple jpg to pdf
Chapter 9. Functions and Operators
Function
Return Type
Description
Example
Result
justify_days(
interval
)
interval
Adjust interval so
30-daytime
periods are
represented as
months
justify_days(interval
’35 days’)
1 mon 5 days
justify_hours(
interval
)
interval
Adjust interval so
24-hour time
periods are
represented as
days
justify_hours(interval
’27 hours’)
1 day
03:00:00
justify_interval(
interval
)
interval
Adjust interval
using
justify_days
and
justify_hours
,
with additional
sign adjustments
justify_interval(interval
’1 mon -1
hour’)
29 days
23:00:00
localtime
time
Current time of
day; see Section
9.9.4
localtimestamp
timestamp
Current date and
time (start of
current
transaction); see
Section 9.9.4
make_date(
year
int
,
month int
,
day int
)
date
Create date from
year, month and
day fields
make_date(2013,
7, 15)
2013-07-15
make_interval(
years
int
DEFAULT 0,
months int
DEFAULT 0,
weeks int
DEFAULT 0,
days
int
DEFAULT 0,
hours int
DEFAULT 0,
mins
int
DEFAULT 0,
secs double
precision
DEFAULT 0.0)
interval
Create interval
from years,
months, weeks,
days, hours,
minutes and
seconds fields
make_interval(days
:= 10)
10 days
make_time(
hour
int
,
min int
,
sec double
precision
)
time
Create time from
hour, minute and
seconds fields
make_time(8,
15, 23.5)
08:15:23.5
219
VB.NET PDF Convert to Jpeg SDK: Convert PDF to JPEG images in vb.
Turn multiple pages PDF into multiple jpg files in VB.NET class. Support of converting from any single one PDF page and multiple pages. Add necessary references:
adding a jpg to a pdf; acrobat insert image into pdf
C# PDF Convert to Jpeg SDK: Convert PDF to JPEG images in C#.net
of converting from any single one PDF page and multiple pages. converter library will name the converted JPEG image file Output.jpg. Add necessary references:
adding an image to a pdf; how to add image to pdf in preview
Chapter 9. Functions and Operators
Function
Return Type
Description
Example
Result
make_timestamp(
year
int
,
month int
,
day int
,
hour
int
,
min int
,
sec double
precision
)
timestamp
Create timestamp
from year, month,
day, hour, minute
and seconds fields
make_timestamp(2013,
7, 15, 8, 15,
23.5)
2013-07-15
08:15:23.5
make_timestamptz(
year
int
,
month int
,
day int
,
hour
int
,
min int
,
sec double
precision
, [
timezone text
])
timestamp
with time
zone
Create timestamp
with time zone
from year, month,
day, hour, minute
and seconds
fields. When
timezone
is not
specified, then
current time zone
is used.
make_timestamptz(2013,
7, 15, 8, 15,
23.5)
2013-07-15
08:15:23.5+01
now()
timestamp
with time
zone
Current date and
time (start of
current
transaction); see
Section 9.9.4
statement_timestamp()
timestamp
with time
zone
Current date and
time (start of
current
statement); see
Section 9.9.4
timeofday()
text
Current date and
time (like
clock_timestamp
,
but as a
text
string); see
Section 9.9.4
transaction_timestamp()
timestamp
with time
zone
Current date and
time (start of
current
transaction); see
Section 9.9.4
In addition to these functions, the SQL
OVERLAPS
operator is supported:
(
start1
,
end1
) OVERLAPS (
start2
,
end2
)
(
start1
,
length1
) OVERLAPS (
start2
,
length2
)
This expression yields true when two time periods (defined by their endpoints) overlap, false when
they do not overlap. The endpoints can be specified as pairs of dates, times, or time stamps; or as a
date, time, or time stamp followed by an interval. When a pair of values is provided, either the start
or the end can be written first;
OVERLAPS
automatically takes the earlier value of the pair as the start.
Each time period is considered to represent the half-open interval
start <= time < end
,unless
start
and
end
are equal in which case it represents that single time instant. This means for instance
220
C# Create PDF from images Library to convert Jpeg, png images to
for combining multiple image formats into one or multiple PDF file in C# images.Add(new Bitmap(Program.RootPath + "\\" 1.jpg")); images.Add(new Bitmap
adding image to pdf; how to add an image to a pdf in reader
VB.NET Create PDF from images Library to convert Jpeg, png images
Turn multiple image formats into one or multiple PDF file. 1.bmp")) images.Add(New REImage(Program.RootPath + "\\" 1.jpg")) images.Add(New REImage
add image to pdf online; how to add jpg to pdf file
Chapter 9. Functions and Operators
that two time periods with only an endpoint in common do not overlap.
SELECT (DATE ’2001-02-16’, DATE ’2001-12-21’) OVERLAPS
(DATE ’2001-10-30’, DATE ’2002-10-30’);
Result:
true
SELECT (DATE ’2001-02-16’, INTERVAL ’100 days’) OVERLAPS
(DATE ’2001-10-30’, DATE ’2002-10-30’);
Result:
false
SELECT (DATE ’2001-10-29’, DATE ’2001-10-30’) OVERLAPS
(DATE ’2001-10-30’, DATE ’2001-10-31’);
Result:
false
SELECT (DATE ’2001-10-30’, DATE ’2001-10-30’) OVERLAPS
(DATE ’2001-10-30’, DATE ’2001-10-31’);
Result:
true
When adding an
interval
value to (or subtracting an
interval
value from) a
timestamp with
time zone
value, the days component advances or decrements the date of the
timestamp with
time zone
by the indicated number of days. Across daylight saving time changes (when the
session time zone is set to a time zone that recognizes DST), this means
interval ’1 day’
does
not necessarily equal
interval ’24 hours’
. For example, with the session time zone set to
CST7CDT
,
timestamp with time zone ’2005-04-02 12:00-07’ + interval ’1 day’
will produce
timestamp with time zone ’2005-04-03 12:00-06’
,while adding
interval
’24 hours’
to the same initial
timestamp with time zone
produces
timestamp with time
zone ’2005-04-03 13:00-06’
, as there is a change in daylight saving time at
2005-04-03
02:00
in time zone
CST7CDT
.
Note there can be ambiguity in the
months
field returned by
age
because different months have
different numbers of days. PostgreSQL’s approach uses the month from the earlier of the two dates
when calculating partial months. For example,
age(’2004-06-01’, ’2004-04-30’)
uses April
to yield
1 mon 1 day
,while using May would yield
1 mon 2 days
because May has 31 days,
while April has only 30.
Subtraction of dates and timestamps can also be complex. One conceptually simple way to perform
subtractionis to convert each value toa number of seconds using
EXTRACT(EPOCH FROM ...)
,then
subtract the results; this produces the number of seconds between the two values. This will adjust for
the number of days in each month, timezone changes, and daylight saving time adjustments. Sub-
traction of date or timestamp values with the “
-
”operator returns the number of days (24-hours) and
hours/minutes/seconds between the values, making the same adjustments. The
age
function returns
years, months, days, and hours/minutes/seconds, performing field-by-field subtraction and then ad-
justing for negative field values. The following queries illustrate the differences in these approaches.
The sample resultswere producedwith
timezone = ’US/Eastern’
;there is adaylightsavingtime
change between the two dates used:
SELECT EXTRACT(EPOCH FROM timestamptz ’2013-07-01 12:00:00’) -
EXTRACT(EPOCH FROM timestamptz ’2013-03-01 12:00:00’);
Result:
10537200
SELECT (EXTRACT(EPOCH FROM timestamptz ’2013-07-01 12:00:00’) -
EXTRACT(EPOCH FROM timestamptz ’2013-03-01 12:00:00’))
/ 60 / 60 / 24;
Result:
121.958333333333
SELECT timestamptz ’2013-07-01 12:00:00’ - timestamptz ’2013-03-01 12:00:00’;
Result:
121 days 23:00:00
SELECT age(timestamptz ’2013-07-01 12:00:00’, timestamptz ’2013-03-01 12:00:00’);
Result:
4 mons
221
C# WPF PDF Viewer SDK to convert and export PDF document to other
Text. Add Text Box. Drawing Markups. Add Stamp Annotation. Create multiple pages Tiff file from PDF document. quality, support converting PDF to PNG, JPG, BMP and
acrobat add image to pdf; add signature image to pdf
C# Create PDF Library SDK to convert PDF from other file formats
Gratis control for creating PDF from multiple image formats such as tiff, jpg, png, gif this PDF document creating toolkit, if you need to add some text
add picture to pdf preview; add jpeg to pdf
Chapter 9. Functions and Operators
9.9.1.
EXTRACT
,
date_part
EXTRACT(
field
FROM
source
)
The
extract
function retrieves subfields such as year or hour from date/time values.
source
must
be a value expression of type
timestamp
,
time
,or
interval
.(Expressions of type
date
are cast to
timestamp
and can therefore be used as well.)
field
is an identifier or string that selects whatfield
to extract from the source value. The
extract
function returns values of type
double precision
.
The following are valid field names:
century
The century
SELECT EXTRACT(CENTURY FROM TIMESTAMP ’2000-12-16 12:21:13’);
Result:
20
SELECT EXTRACT(CENTURY FROM TIMESTAMP ’2001-02-16 20:38:40’);
Result:
21
The first century starts at 0001-01-01 00:00:00 AD, although they did not know it at the time.
This definition applies to all Gregorian calendar countries. There is no century number 0, you
go from -1 century to 1 century. If you disagree with this, please write your complaint to: Pope,
Cathedral Saint-Peter of Roma, Vatican.
day
For
timestamp
values, the day (of the month) field (1 - 31) ; for
interval
values, the number
of days
SELECT EXTRACT(DAY FROM TIMESTAMP ’2001-02-16 20:38:40’);
Result:
16
SELECT EXTRACT(DAY FROM INTERVAL ’40 days 1 minute’);
Result:
40
decade
The year field divided by 10
SELECT EXTRACT(DECADE FROM TIMESTAMP ’2001-02-16 20:38:40’);
Result:
200
dow
The day of the week as Sunday (
0
)to Saturday (
6
)
SELECT EXTRACT(DOW FROM TIMESTAMP ’2001-02-16 20:38:40’);
Result:
5
Note that
extract
’s day of the week numbering differs from that of the
to_char(..., ’D’)
function.
doy
The day of the year (1 - 365/366)
SELECT EXTRACT(DOY FROM TIMESTAMP ’2001-02-16 20:38:40’);
Result:
47
epoch
For
timestamp with time zone
values, the number of seconds since 1970-01-01 00:00:00
UTC (can be negative); for
date
and
timestamp
values, the number of seconds since 1970-01-
01 00:00:00 local time; for
interval
values, the total number of seconds inthe interval
222
C# PDF Convert to Images SDK: Convert PDF to png, gif images in C#
exporting PDF to multiple image forms, including Jpg, Png, Bmp high performance conversions from PDF document to multiple image forms. Add necessary references:
add image to pdf file; add an image to a pdf form
VB.NET Create PDF Library SDK to convert PDF from other file
Gratis control for creating PDF from multiple image formats such as tiff, jpg, png, gif, bmp, etc. Add necessary references: RasterEdge.Imaging.Basic.dll.
add image to pdf file acrobat; adding images to pdf files
Chapter 9. Functions and Operators
SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME ZONE ’2001-02-16 20:38:40.12-08’);
Result:
982384720.12
SELECT EXTRACT(EPOCH FROM INTERVAL ’5 days 3 hours’);
Result:
442800
Here is how you can convert an epochvalue back to a time stamp:
SELECT TIMESTAMP WITH TIME ZONE ’epoch’ + 982384720.12
*
INTERVAL ’1 second’;
(The
to_timestamp
function encapsulates the above conversion.)
hour
The hour field (0 - 23)
SELECT EXTRACT(HOUR FROM TIMESTAMP ’2001-02-16 20:38:40’);
Result:
20
isodow
The day of the week as Monday (
1
)to Sunday (
7
)
SELECT EXTRACT(ISODOW FROM TIMESTAMP ’2001-02-18 20:38:40’);
Result:
7
This is identical to
dow
except for Sunday. This matches the ISO 8601 day of the week number-
ing.
isoyear
The ISO 8601 week-numbering year that the date falls in (not applicable to intervals)
SELECT EXTRACT(ISOYEAR FROM DATE ’2006-01-01’);
Result:
2005
SELECT EXTRACT(ISOYEAR FROM DATE ’2006-01-02’);
Result:
2006
Each ISO 8601 week-numbering year begins with the Mondayof the week containingthe 4th of
January, so in early January or late December the ISO year may be different from the Gregorian
year. See the
week
field for more information.
This field is not available in PostgreSQL releases prior to 8.3.
microseconds
The seconds field, including fractional parts, multiplied by 1000000; note that this includes full
seconds
SELECT EXTRACT(MICROSECONDS FROM TIME ’17:12:28.5’);
Result:
28500000
millennium
The millennium
SELECT EXTRACT(MILLENNIUM FROM TIMESTAMP ’2001-02-16 20:38:40’);
Result:
3
Years in the 1900s are in the second millennium. The third millennium started January 1, 2001.
milliseconds
The seconds field, including fractional parts, multiplied by 1000. Note that this includes full
seconds.
SELECT EXTRACT(MILLISECONDS FROM TIME ’17:12:28.5’);
Result:
28500
223
Chapter 9. Functions and Operators
minute
The minutes field (0 - 59)
SELECT EXTRACT(MINUTE FROM TIMESTAMP ’2001-02-16 20:38:40’);
Result:
38
month
For
timestamp
values, the number of the month within the year (1- 12) ; for
interval
values,
the number of months, modulo12 (0- 11)
SELECT EXTRACT(MONTH FROM TIMESTAMP ’2001-02-16 20:38:40’);
Result:
2
SELECT EXTRACT(MONTH FROM INTERVAL ’2 years 3 months’);
Result:
3
SELECT EXTRACT(MONTH FROM INTERVAL ’2 years 13 months’);
Result:
1
quarter
The quarter of the year (1 - 4) that the date is in
SELECT EXTRACT(QUARTER FROM TIMESTAMP ’2001-02-16 20:38:40’);
Result:
1
second
The seconds field, including fractional parts (0 - 59
1
)
SELECT EXTRACT(SECOND FROM TIMESTAMP ’2001-02-16 20:38:40’);
Result:
40
SELECT EXTRACT(SECOND FROM TIME ’17:12:28.5’);
Result:
28.5
timezone
The time zone offset from UTC, measured in seconds. Positive values correspond to time zones
east of UTC, negativevalues tozones west of UTC. (Technically, PostgreSQL uses UT1 because
leap seconds are not handled.)
timezone_hour
The hour component of the time zone offset
timezone_minute
The minute component of the time zone offset
week
The number of the ISO 8601 week-numbering week of the year. By definition, ISO weeks start
on Mondays and the first week of a year contains January 4 of that year. In other words, the first
Thursday of a year is in week 1 of that year.
In the ISO week-numbering system, it is possible for early-January dates to be part of the 52nd
or 53rd week of the previous year, andfor late-December dates tobe part of the firstweek of the
next year. For example,
2005-01-01
is part of the 53rd week of year 2004, and
2006-01-01
is part of the 52nd week of year 2005, while
2012-12-31
is part of the first week of 2013. It’s
recommended to use the
isoyear
field together with
week
to get consistent results.
SELECT EXTRACT(WEEK FROM TIMESTAMP ’2001-02-16 20:38:40’);
60 if leap seconds are implemented by the operating system
224
Chapter 9. Functions and Operators
Result:
7
year
The year field. Keep in mind there is no
0 AD
,so subtracting
BC
years from
AD
years should be
done with care.
SELECT EXTRACT(YEAR FROM TIMESTAMP ’2001-02-16 20:38:40’);
Result:
2001
The
extract
function is primarily intended for computational processing. For formatting date/time
values for display, see Section 9.8.
The
date_part
functionis modeled on thetraditional Ingres equivalenttothe SQL-standardfunction
extract
:
date_part(’
field
’,
source
)
Note that here the
field
parameter needs to be a string value, not a name. The valid field names for
date_part
are the same as for
extract
.
SELECT date_part(’day’, TIMESTAMP ’2001-02-16 20:38:40’);
Result:
16
SELECT date_part(’hour’, INTERVAL ’4 hours 3 minutes’);
Result:
4
9.9.2.
date_trunc
The function
date_trunc
is conceptually similar to the
trunc
function for numbers.
date_trunc(’
field
’,
source
)
source
is a value expression of type
timestamp
or
interval
.(Values of type
date
and
time
are
cast automatically to
timestamp
or
interval
,respectively.)
field
selects to which precision to
truncate the input value. The return value is of type
timestamp
or
interval
with all fields that are
less significant than the selected one set to zero (or one, for day and month).
Valid values for
field
are:
microseconds
milliseconds
second
minute
hour
day
week
month
quarter
year
decade
century
millennium
225
Chapter 9. Functions and Operators
Examples:
SELECT date_trunc(’hour’, TIMESTAMP ’2001-02-16 20:38:40’);
Result:
2001-02-16 20:00:00
SELECT date_trunc(’year’, TIMESTAMP ’2001-02-16 20:38:40’);
Result:
2001-01-01 00:00:00
9.9.3.
AT TIME ZONE
The
AT TIME ZONE
construct allows conversions of time stamps to different time zones. Table 9-29
shows its variants.
Table 9-29.
AT TIME ZONE
Variants
Expression
Return Type
Description
timestamp without time
zone
AT TIME ZONE
zone
timestamp with time
zone
Treat given time stamp without
time zone as located in the
specified time zone
timestamp with time zone
AT TIME ZONE
zone
timestamp without time
zone
Convert given time stamp with
time zone to the new time zone,
with no time zone designation
time with time zone
AT
TIME ZONE
zone
time with time zone
Convert given time with time
zone to the new time zone
In these expressions, the desired time zone
zone
can be specified either as a text string (e.g.,
’PST’
)
or as an interval (e.g.,
INTERVAL ’-08:00’
). In the text case, a time zone name can be specified in
any of the ways described in Section 8.5.3.
Examples (assuming the local time zone is
PST8PDT
):
SELECT TIMESTAMP ’2001-02-16 20:38:40’ AT TIME ZONE ’MST’;
Result:
2001-02-16 19:38:40-08
SELECT TIMESTAMP WITH TIME ZONE ’2001-02-16 20:38:40-05’ AT TIME ZONE ’MST’;
Result:
2001-02-16 18:38:40
The first example takes a time stamp withouttime zone andinterprets it as MST time (UTC-7), which
is then converted to PST (UTC-8) for display. The second example takes a time stamp specified in
EST (UTC-5) and converts it to local time in MST (UTC-7).
The function
timezone
(
zone
,
timestamp
)
is equivalent to the SQL-conforming construct
timestamp
AT TIME ZONE
zone
.
9.9.4. Current Date/Time
PostgreSQL provides a number of functions that return values related to the current date and time.
These SQL-standard functions all return values based on the start time of the current transaction:
CURRENT_DATE
CURRENT_TIME
226
Chapter 9. Functions and Operators
CURRENT_TIMESTAMP
CURRENT_TIME(
precision
)
CURRENT_TIMESTAMP(
precision
)
LOCALTIME
LOCALTIMESTAMP
LOCALTIME(
precision
)
LOCALTIMESTAMP(
precision
)
CURRENT_TIME
and
CURRENT_TIMESTAMP
deliver values with time zone;
LOCALTIME
and
LOCALTIMESTAMP
deliver values without time zone.
CURRENT_TIME
,
CURRENT_TIMESTAMP
,
LOCALTIME
,and
LOCALTIMESTAMP
can optionally take a
precision parameter, which causes the resulttoberounded to thatmanyfractional digits inthe seconds
field. Without a precision parameter, the result is given to the full available precision.
Some examples:
SELECT CURRENT_TIME;
Result:
14:39:53.662522-05
SELECT CURRENT_DATE;
Result:
2001-12-23
SELECT CURRENT_TIMESTAMP;
Result:
2001-12-23 14:39:53.662522-05
SELECT CURRENT_TIMESTAMP(2);
Result:
2001-12-23 14:39:53.66-05
SELECT LOCALTIMESTAMP;
Result:
2001-12-23 14:39:53.662522
Since these functions returnthe starttime of the current transaction, their values do not changeduring
the transaction. This is considered a feature: the intent is to allow a single transaction to have a
consistent notion of the “current” time, so that multiple modifications within the same transaction
bear the same time stamp.
Note: Other database systems might advance these values more frequently.
PostgreSQL also provides functions that return the start time of the current statement, as well as the
actual current time at the instant the function is called. The complete list of non-SQL-standard time
functions is:
transaction_timestamp()
statement_timestamp()
clock_timestamp()
timeofday()
now()
transaction_timestamp()
is equivalent to
CURRENT_TIMESTAMP
, but is named to
clearly reflect what it returns.
statement_timestamp()
returns the start time of the current
227
Documents you may be interested
Documents you may be interested