Teradata : OGRGeometryFactoryX::createFromWkt failed - teradata

As part of Geospatial analysis, we have created an ST_GEOMETRY field in Teradata and storing GeoSequence data. We are able to insert GeoSequence data type and able to execute GeoSequence methods. But, for certain cases we are unable to insert GeoSequence data.
Below is the problematic record where it is throwing below exception.
INSERT FAILED. [7548] 13 OGRGeometryFactoryX::createFromWkt failed.
Insert Query:
---------------------
INSERT INTO PLAP_TEMP.SHAPES_WORK
VALUES (7234, 'GeoSequence((
103.849156 1.288848,
103.848589 1.287925,
103.847986 1.286837,
103.8475 1.286561,
103.845948 1.28738,
103.842801 1.289602,
103.842306 1.289904,
103.841407 1.288665,
103.839099 1.288882,
103.8377 1.288771,
103.835302 1.289199,
103.8319 1.290346,
103.827 1.29049,
103.825797 1.28810
),
(
2017-03-01 23:51:59,
2017-03-01 23:52:10,
2017-03-01 23:52:24,
2017-03-01 23:52:48,
2017-03-01 23:53:25,
2017-03-01 23:53:31,
2017-03-01 23:53:46,
2017-03-01 23:54:19,
2017-03-01 23:54:32,
2017-03-01 23:54:51,
2017-03-01 23:55:23,
2017-03-01 23:56:01,
2017-03-01 23:56:40,
2017-03-01 23:56:39
),
(
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
),
(0))'
);
The Lat-Lng values corresponds to Singapore.
Could anyone kindly help to review this query and identify what could be the issue.
Thanks and Regards,
~Paul

Related

Backtrader: How can I have stops execute on the same bar they were entered on?

I'm confused about the behavior of stop orders. Consider the example below, in which the stop price is reached on the same bar on which the order is entered. However, the stop is not executed.
In this example, both the buy and the stop orders are placed on the 2022-01-02 bar, with a stop of 10.0. The buy is executed as expected, at a market price of 11.1 (the open price of the bar). However, the stop order is not executed, even though the low of the bar is 10.0.
In general in my tests it appears that stops are never executed on the same bar they are entered on, even though conceptually the orders are placed (and executed) at bar open, an presumably any low price of the bar happens after bar open.
Is this expected behavior and a limitation in Backtrader, and if so, is there a workaround?
Here's some sample output which illustrates this behavior:
Starting Portfolio Value: 10000.00
2022-01-01 OHLC: 10.1, 10.3, 10.0, 10.2
2022-01-01 placing buy order
2022-01-02 1: Buy Market: Submitted: 10 # None
2022-01-02 2: Sell Stop: Submitted: -10 # 10
2022-01-02 3: Sell Limit: Submitted: -10 # None
2022-01-02 1: Buy Market: Completed: 10 # 11.1
2022-01-02 OHLC: 11.1, 11.3, 10.0, 11.2
2022-01-03 3: Sell Limit: Completed: -10 # 12.1
2022-01-03 2: Sell Stop: Canceled
2022-01-03 OHLC: 12.1, 12.3, 12.0, 12.2
2022-01-03 placing buy order
Final Portfolio Value: 10010.00
Here's the code that generates this output:
import backtrader as bt
import pandas as pd
from io import StringIO
class TestStrategy(bt.Strategy):
def log(self, txt, dt=None):
dt = dt or self.datas[0].datetime.date(0)
print(f"{dt.isoformat()} {txt}")
def next(self):
d = self.data
self.log(f"OHLC: {d.open[0]}, {d.high[0]}, {d.low[0]}, {d.close[0]}")
if self.position.size == 0:
self.log("placing buy order")
self.buy_bracket(size=10, stopprice=10, exectype=bt.Order.Market)
def notify_order(self, order):
id = order.ref
created = bt.num2date(order.created.dt).strftime('%Y-%m-%d %H:%M')
status_name = order.Status[order.status]
ordtype_name = order.ordtypename()
exectype_name = order.ExecTypes[order.exectype]
order_header = f"{id}: {ordtype_name} {exectype_name}: {status_name}"
order_info = f"{order.size} # {order.price}"
exec_info = f"{order.executed.size} # {order.executed.price}"
if order.status in [order.Completed]:
self.log(f"{order_header}: {exec_info}")
elif order.status in [order.Submitted, order.Accepted]:
if order.status == order.Submitted:
self.log(f"{order_header}: {order_info}")
else:
self.log(f"{order_header}")
if __name__ == '__main__':
#make sure you use tabs as separators, not spaces in this input string, or change the separator in `read_csv` below
data ="""
datetime open high low close
2022-01-01 10.1 10.3 10.0 10.2
2022-01-02 11.1 11.3 10.0 11.2
2022-01-03 12.1 12.3 12.0 12.2
"""
prices = StringIO(data)
df = pd.read_csv(prices, sep = '\t', parse_dates=True, index_col=0)
pricedata = bt.feeds.PandasData(dataname = df)
cerebro = bt.Cerebro()
cerebro.addstrategy(TestStrategy)
cerebro.adddata(pricedata)
print('Starting Portfolio Value: %.2f' % cerebro.broker.getvalue())
cerebro.run()
print('Final Portfolio Value: %.2f' % cerebro.broker.getvalue())

How to multiply vectors of 2 dataframes if the columns have the same name?

I'm computing the times of two rows that belong to two different data frames but with the same colnames and the same length?
for (i in names(TIV) {for(j in names(urban.exp)) { result <- c(result, TIV[i] * urban.exp[j])}}
the TIV is 26 obs and 23 variables
the urban.exp is 26 obs and 197 variables
However, names in TIV are all unique and in urban.exp are repeated. I want to multiply each colnames in urban.exp (let's say there is 3) by the one in TIV, I want an elementwise multiplication).
dput(TIV)
structure(list(ALB = c(0.000248174906521353, 0.000339169273748206,
0.000159632297757388, 0.000228630507732613, 0.000267866815239384,
0.000289021390436638, 0.000428600968670754, 0.000359599958169296,
0.000285798240881231, 0.000351193053463129, 0.000350073894209511,
0.000978402075126559, 0.000509607726186487, 0.000474370444647724,
0.0009013352987314, 0.000919698063539768, 0.000931573514218432,
-6.02817288364908e-05, 0.00147380111581113, 0.000138068449732178,
7.13563367172184e-05, 0.000203140614523849, 0.000141125871924299,
0.000596973372585642, 0.000476357937555003, 0.0159934624248568
), DZA = c(0.000268396126256534, 0.00041499462052619, 0.000775855329071962,
0.000247614710989086, 0.00025371478550621, 0.000270821107879502,
0.000843441012186421, 0.000284398589838246, 0.000234477520662322,
0.000304042023076104, 0.000306305994281338, 0.000911873116533145,
0.00433211883574542, 0.000287545845467517, 0.000840538271603211,
-0.00320821964214054, 0.00475209613678138, -5.7290313092215e-05,
0.00213214430861042, 0.000114926712176887, 3.95917869655464e-05,
0.000251224071825662, 9.26822881382479e-05, 0.000460120203572431,
0.000255400796998768, -0.000254677157762396), BGD = c(0.000913338803874099,
0.000686108490364341, 0.000341395391373583, 0.000617209735009716,
0.00039797020138852, 0.000535263235754845, 0.000791566547477367,
0.000514028603231846, 0.000447276226487732, 0.000620114352054082,
0.000458591335459696, 0.00113114852677669, 0.009344425309504,
0.000630088174844855, 0.000959788528715684, 0.00104208072663453,
0.00117124840139069, -0.0469185795987902, 0.00158956762460143,
0.000217013947387598, 9.86773825322874e-05, 0.000271682582804807,
0.00023677199816467, 0.000831280500571276, 0.000555615271844585,
0.000942900765747189), BWA = c(0.000482117130379816, 0.000830244164580518,
0.0010254054258111, 0.000607072653315362, 0.000501231634671083,
0.000567616051110543, 0.000645457366742526, 0.000629605702268291,
0.000544685850129081, 0.000663044347955545, 0.000616545336715966,
0.0011139523841532, 0.00348953770692895, 0.000745614665488414,
0.00143510348232541, 0.00774019660647544, 0.00127052511998079,
0.000702994537318256, 0.00290565160847126, 0.000231931061991944,
0.000139437569893227, 0.000501985666752962, 0.000265908463051288,
0.000924269112899131, 0.000593497744163397, 0.00148883147377942
), BGR = c(0.000749598761828107, 0.000470535484932322, 0.000720674449220904,
0.000603227998691483, 0.000621004551337537, 0.000677626877413007,
0.000846521827869615, 0.00072421651063374, 0.000574760151566309,
0.000606340404903733, 0.000641753079513222, 0.00121667823080637,
0.00874076933500097, 0.000805997461660357, 0.00144446719326409,
0.00454146878811612, 0.00160946106966851, 0.000549577359307621,
0.0030412166447252, 0.000357055859646755, 0.000252394867645304,
0.000512263155725499, 0.000393777474739842, 0.000297806719907053,
0.000350807409141673, 0.00160360060359238), CHN = c(0.002208261,
0.001017573, 0, 0.007292695, 0.007154744, 0.004281515, 0.01439357,
0.006233652, 0.024742643, 0.004137592, 0.012933709, 0.000567579,
0.001202401, 0.001177813, 0.001011665, 0.001888206, 0, 0.001511387,
0.014257881, 0.001691124, 0.002472086, 0.00090825, 0.008202734,
0, 0.000774492, -0.000511294), CRI = c(0.000173802315054641,
0.000254763819792943, 0.00017095487110465, 0.000190916370461249,
0.000163013891471559, 0.00019023810268046, 0.000241830401487632,
0.000195528103604298, 0.000181694294574444, 0.00023970293344353,
0.000191302817493573, 0.000502674620550298, 0.000504081860272143,
0.000198365018149506, 0.000293652208460809, 0.000103385426910766,
8.79269368020482e-05, 0.000363590084937558, -0.000356578266563247,
0.000109963755347626, 6.0964616360274e-05, 0.000180258775514208,
0.00010363324527303, 0.000532655161887979, 0.000305765870009219,
0.000299797339793439), CIV = c(0.000315874772473806, 0.000477073049291911,
0.000384174754204304, 0.000249719402871909, 0.000240229791946855,
0.000277924914654865, 0.000341162342372984, 0.000252520430814487,
0.000216558937346997, 0.000284311763635522, 0.000272649034343662,
0.000717120358981288, 0.00263743595952355, 0.000258461840061832,
0.000815425034976343, 0.000779303543601924, 0.000684210781801615,
0.0004345543613646, 0.00116728144643683, 0.000139655116666953,
7.98182805799198e-05, 0.000213312901529751, 0.00014912204987226,
0.000894440765688311, 0.000477558986104314, 0.000543283600887808
), GEO = c(0.005279151, 0.001684205, 0.002129969, 0.00411568,
0.000915426, 0.000728686, 0.005128433, 0.000790025, 0.00103,
0.000677533, 0.000925394, 0, 0.012840032, 0.00127411, 0.000325425,
0.000322409, 0.000844766, 0.000493057, 0.006683474, 0.000532039,
0.013881833, 7.73e-05, 0.001214205, 0, 0.001580739, -5.84e-05
), MYS = c(-0.0015130772816436, -0.0180260256928713, -0.00157505344574275,
0.000648534057061993, -0.00155740623112013, -0.00156283166303776,
-0.00174340172748788, -0.00286197558369102, 0.00454689685232959,
-0.0018938367416353, -0.00157663033130427, -0.0119022065132133,
-0.00175299958373901, -0.0664537247250796, 0.0890100074952729,
-0.00201299170182833, -0.00388584109571892, -0.00287411604410686,
0.00278277588580321, 0.00104715403241539, -0.00149602941092311,
-0.0348283953747052, 0.00845292602307031, 0.201406414092222,
-0.00159940992570112, 0.0522417938445839), MDV = c(0.000352490450642571,
0.000550328997212354, 0.000723764266026371, 0.000498694126592643,
0.000376656259071883, 0.000568444835699374, 0.000553226062140765,
0.000539125917393749, 0.000455725570252103, 0.000582716407592034,
0.000547111484301339, 0.000748961765363705, 0.00252751733647313,
0.000461514218724202, 0.00111914867302241, 0.00674965246948192,
0.000814018100861111, 0.000398847050156113, 0.00197233454579513,
0.000216093986731238, 0.000221521928466968, 0.000433770489564185,
0.000320690153287247, 0.000803622183313035, 0.000963639810417282,
0.00105293243540671), MEX = c(0.000944224, 0.000241484, 0.000316814,
0.000547203, 0.00143669, 0.001033885, 0.003081825, 0.000896958,
0.002083657, 0, 0, 0, 0.006803516, 0.000501264, 0.000174385,
0.000142901, 0, 0, 0.010874537, 0.000616828, 0.001332897, 0.000293279,
0.002337931, 3.83e-06, 0, 6.46e-05), MNE = c(0.00012150207923852,
0.000477285337384979, 0.000160591667954874, 0.000168767228777349,
0.000230170002753131, 0.000199263460677769, 0.000141641421346877,
0.000191481985831653, 0.000166052527785696, 0.000233029831804151,
0.000242124674425282, 0.00044027771995825, 0.000189898429234294,
0.000188755929720485, 0.000493370655299545, 9.38389984119552e-05,
0.000123067692063739, 0.000185289145009044, 0.000100127504002848,
0.000140122390705789, 5.36773652866665e-05, 0.000126910780848532,
0.000102783645088524, 0.000883716493977761, 0.000655194916948705,
0.000619806723692673), MAR = c(0.000576230588222724, 0.000385565321949467,
0.000345251076888296, 0.000483401422068128, 0.000417547948938127,
0.000445795253675645, 0.000695651547697528, 0.000435693352572054,
0.000387010806414357, 0.000450117039837095, 0.000432861427345239,
0.00088113576907869, 0.00507307136732021, 0.00047563908243884,
0.000985012231911927, 0.00261731373390549, 0.00118859850891973,
0.000756818875820843, 0.00214454134266875, 0.00019073938090137,
0.000105582005170888, 0.000347913510249089, 0.000146312464918241,
0.000397294179428336, 0.000336379968259507, 0.00583520138552966
), NAM = c(0.000445328582066306, 0.00068426871215696, 0.000537305638480289,
0.000407821878397232, 0.000438544612487918, 0.000448135959028999,
0.000449507784509406, 0.000667721676321114, 0.000445085615960187,
0.000537384415020835, 0.000564794265575911, 0.0010153798792818,
0.000393277394152737, 0.000510643021599451, 0.00167611519040259,
0.00181461346467337, 0.00173375774499516, 0.000404846140809306,
0.00295361961134029, 0.000283639921226707, 0.000129162928641247,
0.000328583967508361, 0.000213893132958698, 0.00112842286830381,
0.000808424289723378, 0.0017028605151185), ASM = c(0.000145277572623218,
0.000330744638372967, 0.000301739976711475, 0.000213198056186216,
0.000271157191143214, 0.000259969796260232, 0.000247505072371561,
0.000255936924306282, 0.000214221405273054, 0.00027795667828277,
0.000304520178949443, 0.000451062121502298, 0.000393308980271543,
0.000114739885478548, 0.000608851923796505, 0.000843247013860957,
0.000599326495306679, 0.000252193741355666, 0.00138391529151655,
0.000127141687633323, 0.000182794659741862, 0.000288162870762742,
0.000246646241763648, 0.000381188885283242, 0.00058956932071467,
0.000381203990621746), ZAF = c(0, 0, 0, 0.008086651, 0.003526301,
0.008866077, 0.008638975, 0.013957369, 0.018945326, 0.003328869,
0.019784222, 0, 0.023228398, 0.002659621, 0, 0.000469439, 0.000261756,
0.000677452, 0.002014355, 0.000494417, 0.00070504, 0.000241015,
0.000421291, 0, 0.000756811, -7.81e-05), LKA = c(0.00032062899351777,
0.000163597655966227, 0.000164607201496355, 0.00022401980855161,
0.000185520448859277, 0.000214416338839827, 0.000303232936661481,
0.000220874598550123, 0.00019864469092968, 0.000279143124358859,
0.000237984611683141, 0.000411844500747206, 0.00193210615617892,
0.000237144260723747, 0.000670796981341913, 0.0010596649470119,
0.000970548396088071, 0.000447278000994621, 0.00170669404804761,
8.79527325411458e-05, 5.52875192092355e-05, 0.000151072122665778,
5.97154662557204e-05, 0.000100662627853025, 0.000123716763365379,
-0.00256348718238034), TUN = c(0.000444076147499441, 0.000610241398352655,
0.000656084832438002, 0.000439695762520918, 0.000426498556457417,
0.000473733195405614, 0.000723973432473194, 0.000472157924701055,
0.000410679108252149, 0.000487185316546125, 0.000467386957504676,
0.00113370594038486, 0.0049715366490553, 0.000492612136619973,
0.0010211452992161, -0.000731108197555239, 0.00116458699063456,
-0.000359141563614933, 0.00182543211311049, 0.000210272293203948,
0.000129356195732316, 0.000394545538241387, 0.000251344539116984,
0.000946545872452504, 0.000536863794260094, 0.00187101573108743
), UKR = c(0.004882587, 0, 0, 0.017154939, 0.003483648, 0.012498412,
0.033416735, 0.008278118, 0.021719782, 0.001383677, 0.013522355,
0, 0.004676683, 0.017151558, 0.002241068, 0, 0.001078673, 0,
0.00731783, 0.001894759, 0.007383462, 0, 0.003917305, 0, 0.001327347,
0.001703462), VNM = c(0.012146918, 0.001980802, 0, 0.018360841,
0.009105785, 0.00451478, 0.011848205, 0.004563223, 0.005829405,
0.00522886, 0.003129561, 0, 0.015882704, 0.002322068, 0.000696516,
0.000524715, 0, 0.00234702, 0.052990123, 0.000458449, 0.007569633,
0, 0.009779507, 0, 0.00104515, 0.000558566), ZMB = c(0.000185538679940368,
0.000228694546854409, 0.000383949747881978, 0.000254342140542114,
0.000232362262307685, 0.000266148738913681, 0.000511992931034977,
0.000259166340696073, 0.00026270606044175, 0.00035794076067972,
0.000292400223534108, 0.000619976846061065, 0.000330464208700282,
0.000265557476637801, 0.000711524137616014, 0.00116329601953602,
0.000799451656258591, 0.000249376561695306, 0.00155784130089073,
0.000122204936450822, 0.000117407505221938, 0.000191158548225592,
0.000154728626840974, 0.000254644598879221, 0.000216618820294215,
-0.0582015964277787), ZWE = c(0.017749199607316, 0.0181301024162438,
0.0193645828015996, 0.0180011524832997, 0.0180772730678022, 0.0179081302943255,
0.0183263614878677, 0.0188799313913344, 0.0177187155287076, 0.0180093829576111,
0.0180562811976393, 0.0182044885084857, 0.0337412434812055, 0.0184421026669123,
0.0180483629775726, 0.0241177668870026, 0.0245657716836954, 0.024751860680692,
0.00663079658780753, 0.0176168200947908, 0.0185266072831957,
0.0176464697715503, 0.0176983948493923, 0.0181381302428299, 0.0180702616866683,
0.0180891094091982)), class = "data.frame", row.names = c(NA,
-26L))
You can isolate the columns directly and multiply them. Say the 3 TIV columns are column numbers 4, 7, 9 and the corresponding column numbers in urban.exe are 2, 11, 15 then
result <- TIV[ , c(4,7,9)] * urban.exp[ , c(2,11,15)]
Should give you the result you want.

MariaDB 10.3 gap of numbering of the sequence

I have a table where id is primary key and squence.
In transaction I call sequence
select NEXTVAL(next_cons_id) as next_cons_id
then create a new record where field id = next_cons_id got from code bellow.
DDL sequence
CREATE SEQUENCE IF NOT EXISTS next_cons_id START WITH 1;
In most cases it work well.
Having done a small study I found some patterns.
Id, ... gap ..., nextId
606401,605557,
604556,605401,
603555,604401,
602594,603401,
601594,602401
Ids with dates:
601594 2019-10-10 00:04:54
602401 2019-10-10 01:36:33
602594 2019-10-10 21:46:43
603401 2019-10-11 01:19:49
603555 2019-10-11 21:41:26
604401 2019-10-12 00:30:09
604556 2019-10-13 00:15:32
605401 2019-10-13 03:51:42
605557 2019-10-13 22:42:22
606401 2019-10-14 02:14:28
And after I did create console script that make insert by one record per second in test table:
237343 2019-10-14 00:31:03 2019-10-14 00:31:03
237344 2019-10-14 00:31:03 2019-10-14 00:31:03
....gap...
238000 2019-10-14 00:31:04 2019-10-14 00:31:04
It table use only test script.
But it time we can see some problem:
There were no network problems at this point
In monitoring of zabbix rollback of transactions not found.
Database has one replication server.
Server version: 10.3.13
Do you have any ideas to fix this?
UPD:
I remove the sequence and recreate this table with
id primary key autouncrement but this case has been repeated.

SQLite Persist Update

I'm using SQLite on Windows UWP (10).
This is what I am doing:
Open connection
Begin Transaction
Update row
Commit Transaction
Close connection
And yet, the value in the database is not actually written to the table. When I reload the record (after disconnecting and reconnecting, or not disconnecting) the value remains from before I called the update.
Is there something extra I need to do? In DB Browser for SQLite, there is a menu item called "Write Changes". What does that do? Just a normal commit? In the browser, the changes are only committed if I click on this menu item.
Also, I put a trace on the connection, and this is what came up:
Executing: begin transaction
Executing: UPDATE
'TaskManagement.TaskInfo'
SET
StatusKey = #StatusKey, ProbAddDttm = #ProbAddDttm, ProbCode = #ProbCode, ProbPriority = #ProbPriority, ProbGroup = #ProbGroup, ProbInsp = #ProbInsp, Activity = #Activity, UpdateDttm = #UpdateDttm, Asset = #Asset, Address = #Address, TaskStartDttm = #TaskStartDttm, MaintenanceScheduleSetup = #MaintenanceScheduleSetup, MaintenanceScheduleBatch = #MaintenanceScheduleBatch, ProbZone = #ProbZone, ProbContractor = #ProbContractor, ProbNotes = #ProbNotes, JobCompleted = #JobCompleted, Resolution = #Resolution, Result = #Result, ActType = #ActType, Complaint = #Complaint, BudgetNo = #BudgetNo, Contractor = #Contractor, MapLocCorrect = #MapLocCorrect, FollowUpWorkRequired = #FollowUpWorkRequired, Condition = #Condition, ActPriority = #ActPriority, ExpectedVersion = #ExpectedVersion, EmailProbOriginator = #EmailProbOriginator, IsBug = #IsBug, IsCompletePendingCheckIn = #IsCompletePendingCheckIn
WHERE
TaskInfoKey = #PrimaryKey
0: 63711ec4-57d0-4a23-8595-0022b757af44
1: 6
2: 2013-06-03 08:56:39:117
3: 13
4: 2
5: 17
6: 24
7:
8: 2015-11-10 04:05:09:502
9:
10:
11: 2013-06-03 08:56:39:117
12:
13:
14:
15:
16: Test this mofo!
17: 2013-08-15 12:13:24:620
18:
19:
20:
21:
22:
23: 4
24: False
25: False
26:
27:
28: 3
29: False
30: False
31: False
Executing: Commit
So, in the end, the problem was that I was not passing the parameters in to the library correctly. The connection's CreateCommand method only allows you to pass in the command text, and an array of objects. This is incorrect because that means you can't name the parameters. So, I consider this a piece of missing functionality in this particular implementation of SQLite for UWP.
Secondly, this should have errored! None of the parameter names I mentioned above were passed in to the command, and yet when I ran it, no exception was thrown. So, I consider this to be the second bug in the implementation.
I fixed it like this:
var command = _Connection.CreateCommand(commandText, new object[0]);
if (parameters != null)
{
foreach (var parameter in parameters)
{
if (parameter.ParameterValue is DateTime)
{
parameter.ParameterValue = ((DateTime)parameter.ParameterValue).ToString("yyyy-MM-dd hh:mm:ss:fff");
}
command.Bind(parameter.ParameterName, parameter.ParameterValue);
}
}
return command;

Don't know what format date is to be able to parse it '[1252457867]'

I have a date/time field from a shopping cart API feed, but I don't know what format it is in and I don't have access to the database.
What could [1252457867] be for a date?
These dates are all within the last couple weeks
Any ideas?
Clearly a unix timestamp.
1252457867 = 09 Sep 2009 - 02:57:47
This sounds like seconds since the Unix Epoch (January 1, 1970).
That looks like seconds elapsed since Jan. 1st, 1970 12:00AM.
Use this function to get the date:
var baseDate = new DateTime(1970, 1, 1, 0, 0, 0);
var transactionDate = baseDate.AddSeconds(1252457867);
This will output {9/9/2009 12:57:47 AM} PST
**EDIT: **
If you need UTC:
var utcDate = baseDate.AddSeconds(1252457867).ToUniversalTime();
This outputs {9/9/2009 7:57:47 AM}
--Adam

Resources