文档库 最新最全的文档下载
当前位置:文档库 › Photovoltaic Generator as an Input Source for Power Electronic Converters

Photovoltaic Generator as an Input Source for Power Electronic Converters

Photovoltaic Generator as an Input Source for Power Electronic Converters
Photovoltaic Generator as an Input Source for Power Electronic Converters

Photovoltaic Generator as an Input Source for Power

Electronic Converters

Lari Nousiainen,Student Member,IEEE,Joonas Puukko,Student Member,IEEE,Anssi M¨a ki,Student Member,IEEE, Tuomas Messo,Student Member,IEEE,Juha Huusari,Student Member,IEEE,Juha Jokipii,Student Member,IEEE, Jukka Viinam¨a ki,Diego Torres Lobera,Student Member,IEEE,Seppo Valkealahti,Member,IEEE,

and Teuvo Suntio,Senior Member,IEEE

Abstract—A photovoltaic(PV)generator is internally a power-limited nonlinear current source having both constant-current-and constant-voltage-like properties depending on the operating point.This paper investigates the dynamic properties of a PV gen-erator and demonstrates that it has a profound effect on the opera-tion of the interfacing converter.The most important properties an input source should have in order to emulate a real PV generator are de?ned.These properties are important,since a power elec-tronic substitute is often used in the validation process instead of a real PV generator.This paper also quali?es two commercial solar array simulators as an example in terms of the de?ned properties. Investigations are based on extensive practical measurements of real PV generators and the two commercial solar array simula-tors interfaced with dc–dc as well as three-and single-phase dc–ac converters.

Index Terms—Converter,inverter,photovoltaics(PVs),solar array simulator,validation.

I.I NTRODUCTION

I NSTALLED capacity of photovoltaic generator(PVG)-

based energy systems is rapidly growing due to advantageous public and political climates[1].Such systems are interfaced to dc or ac loads with power electronic devices,which have been shown to cause,e.g.,harmonic distortion,reduce damping in the utility grid,and suffer from reliability problems[2]–[5]. These phenomena can even lead to instability or production outages and are expected to increase as the penetration depth of distributed generation grows[6],[7].Therefore,an extensive validation process,which characterizes dynamic properties of the proposed interfacing converters,is of utmost importance to overcome or minimize the problems.

The input source has a signi?cant effect on converter dynam-ics,as discussed in detail in[8]–[10].A PVG is internally a

Manuscript received April10,2012;revised June12,2012;accepted July10, 2012.Date of current version December7,2012.Recommended for publication by Associate Editor Q.-C.Zhong.

L.Nousiainen and J.Puukko were with the Department of Electrical Energy Engineering,Tampere University of Technology,Finland.They are now with ABB Drives,Helsinki,Finland(e-mail:lari.nousiainen@?https://www.wendangku.net/doc/c115012618.html,; joonas.puukko@?https://www.wendangku.net/doc/c115012618.html,).

A.M¨a ki,T.Messo,J.Jokipii,J.Viinam¨a ki, D.T.Lobera, S.Valkealahti,and T.Suntio are with the Department of Electrical Energy Engineering,Tampere University of Technology,Tampere,Finland(e-mail: anssi.maki@tut.?;tuomas.messo@tut.?;juha.jokipii@tut.?;jukka.viinamaki@ tut.?;diego.torres@tut.?;seppo.valkealahti@tut.?;teuvo.suntio@tut.?).

J.Huusari is with ABB Corporate Research,Baden-D¨a ttwil,Switzerland (e-mail:juha.huusari@https://www.wendangku.net/doc/c115012618.html,).

Digital Object Identi?er10.1109/TPEL.2012.2209899power-limited nonlinear current source having both constant-current(CC)and constant-voltage(CV)like properties depend-ing on the operating point[11],which implies that the dynamics of a photovoltaic interfacing converter(PVIC)cannot be vali-dated solely by using a voltage or current source as the input source.Therefore,the validation should be performed using a real PVG as the input source.

If a real PVG is to be used in the PVIC validation process,an arti?cial light source providing controllable illumination should be used to guarantee the repeatability of the measurements. This can be accomplished cost effectively in small scale,e.g., for a single PV module,but is impractical for larger systems. Therefore,a PVG is usually replaced with a power electronic substitute,i.e.,a solar array simulator,so that time-invariant conditions can be guaranteed in the validation.

This paper presents the dynamic properties of a real PVG, de?nes the most signi?cant parameters that will have an ef-fect on PVIC dynamics,and demonstrates these effects by ex-perimental measurements based on dc–dc as well as single-and three-phase dc–ac converters.This paper also quali?es two commercial solar array simulators as an example in terms of the de?ned properties and analyzes the differences between the solar array simulators and real PVGs both in time and frequency domains.

The rest of the paper is organized as follows.The dynamic properties of PVGs are reviewed in Section II.The effects of PVG on the interfacing converter dynamics are presented in Section III.Section IV compares the dynamic properties of the commercial solar array simulators with real PVGs and de?nes the characteristics an input source should have in order to emu-late a real PVG.Conclusions are drawn in Section V.

II.D YNAMIC P ROPERTIES OF A PV G ENERATOR

A simpli?ed electrical equivalent circuit of a PV cell com-poses of a photocurrent source with parallel-connected diode and parasitic elements,as depicted in Fig.1[11],[12].In Fig.1, i pv and u pv are the output current and voltage of the PV cell, respectively,i ph is the photocurrent,which is linearly propor-tional to the irradiance,i cpv is the current through the shunt capacitance c pv,and i rsh is the current through the shunt resis-tance r sh.The shunt and series resistances r sh and r s represent various nonidealities in a real PV cell.The relation between diode current i d and voltage u d can be modeled with an ex-ponential equation,yielding a nonlinear resistance r d that can be used instead of the diode symbol in Fig.1[11],[13].The

0885-8993/$31.00?2012IEEE

Fig.1.Simpli?ed electrical equivalent circuit of a photovoltaic cell.

0.0

0.20.40.60.8 1.0 1.2

0.00.20.40.60.81.01.2Volta g e (p.u .)

C u r r e n t , p o

w e r , r e s i s t a n c e a n d c a p a c i t a n c e (p .u .)

Fig.2.Static and dynamic terminal behavior of a PVG.

one-diode model can also be used to model the operation of a PV module,i.e.,a series connection of PV cells,by scaling model parameters,as presented in [12].

The measured static and dynamic characteristics of a PV mod-ule are shown in Fig.2as normalized (p.u.)values.The mea-surement setup has been reported earlier in detail in [14].The static current–voltage and power–voltage characteristics show that the PV module is a highly nonlinear current source having limited output voltage and power.In order to maximally utilize the energy of solar radiation by using a PVG,the operating point has to be kept at the maximum power point (MPP)in which

d p pv

d u pv =d(u pv i pv )d u pv =I pv +U pv d i pv d u pv

=0(1)

where I pv and U pv are the MPP current and voltage,respectively.

The dynamic behavior of the PV module is shown in Fig.2in terms of its dynamic resistance r pv =r d r sh +r s and capac-itance c pv ,which are nonlinear and dependent on the operat-ing point.The dynamic resistance represents the low-frequency value of the impedance shown in Fig.3and is the most signif-icant variable that will have an effect on the PVIC dynamics,as presented in more detail in Section III.The dynamic capaci-tance,in turn,can be approximated from PVG impedance (see

10

110

2

10

3

10

4

10

5

10

6

?20

0204060M a g n i t u d e (d B Ω)

10

110

2

103

104

105

10

6

?90

?4504590

P h a s e (d e g )

Freq u ency (Hz)

Fig.3.PVG impedances at short circuit (SC),MPP,and open circuit (OC).

Fig.3)as

c pv ≈

1

2πr pv f ?3dB

(2)

where f ?3dB is the cutoff frequency of the impedance magni-tude curve.Equation (2)gives a good estimate for c pv in the

CC region,since r d r sh r s .In CV region,(2)slightly un-derestimates c pv since r d r sh and r s are in the same order of magnitude,but is still suf?ciently accurate.

According to Kirchhoff’s laws,the analyzed or measured output impedance of a device is ?Z ,if the direction of positive current ?ow is de?ned out of the device as in Figs.1and 2.Thus,the dynamic resistance r pv (or the incremental resistance as named in [15])is in fact positive since Δu pv /Δi pv in Fig.2is negative and has to be multiplied by “?1”to obtain the correct impedance.

III.D YNAMIC E FFECTS ON THE C ONVERTER

Dynamic properties of a power electronic converter are deter-mined not only by the power stage but also by the type of source and load subsystems,which in turn de?ne the possible feedback variables.It has been shown in detail in [8]–[10]that the input source has a profound effect on the dynamics of the converter connected to it.The same power stage can be supplied either by a source that has current or voltage-source-like properties.The converter dynamics are completely different in these two cases.According to circuit theory and control engineering princi-ples,the input variables are uncontrollable and only the out-put variables can be controlled.In practice,this means that an input-voltage-controlled converter (as usually adopted in PV applications for enabling maximum power transfer [16])has to be analyzed as a current-fed system (i.e.,input current is an uncontrollable input variable and input voltage is a controllable output variable)as will be done in the following sections.A.DC–AC Interfacing

Figs.4and 5show conventional single-and three-phase VSI-type PV inverters usually applied in interfacing PVGs to the

o

Fig.4.VSI-type single-phase PV inverter.

Fig.5.VSI-type three-phase PV inverter.

d

Fig.6.Linear small-signal model of a single-phase inverter[17].

utility grid.Dynamic properties of these inverters can be an-alyzed by constructing small-signal models that describe the dynamics between the uncontrollable input variables and the controllable output variables,as presented in Figs.6and7,as linear small-signal models.Detailed modeling procedures for the single-and three-phase inverters can be found,e.g.,from[10] and[17].

The operating-point-dependent dynamic effect of a PVG can be taken into account by considering the source as a parallel con-nection of a current source i inS and source admittance Y S.Ac-cording to Fig.3,PVG impedance behaves as an RC circuit up to typical converter switching frequencies(c.a.1...100kHz). The source impedance Z S can be given according to Fig.1by

Z S=r s+r d r sh

1

sc pv

=

r p v

r s+r d r sh+sc pv r s(r d r sh)

1+sc pv r s(r d r sh)

(3)

Fig.7.Linear small-signal model of a three-phase inverter in synchronous

reference frame[10].

100101102103104

?40

?20

20

40

M

a

g

n

i

t

u

d

e

(

d

B

A

)

100101102103104

?360

?270

?180

?90

90

180

270

P

h

a

s

e

(

d

e

g

)

Freq u ency (Hz)

Fig.8.Three-phase inverter control-to-output-current transfer function

G co-d.Measurements with solid lines,prediction using measured source

impedance with dotted lines,and prediction using(5)with dashed line.

which can be approximated by considering r s=0and r pv=

r d r sh+r s as

Z S≈r d r sh

1

sc pv

≈r pv 1

sc pv

(4)

and further at low frequencies by

Z S≈r pv.(5)

The use of(5)instead of(4)is justi?ed if the interfacing con-

verter input capacitance C in c pv,which typically applies.

Fig.8shows measured three-phase inverter control-to-output-

current transfer functions G co-d compared with predictions ob-

tained using either the measured source impedances or their

low-frequency values,i.e.,(5),to model the effect of the source.

The results show high correlation,which con?rms the analysis.

According to the notations of Figs.4and5as well

as using Y S=1/Z S=1/r pv,the control-to-output transfer

functions G co and G co-d without the parasitic elements for

single-and three-phase inverters can be given by

G co=U i n

L

s?1

C

I i n

U i n

?1

r p v

s2+1

r p v C

s+D2

LC

(6)

G co-d=

U i n

L

s

s?1

C

I i n

U i n

?1

r p v

s

s2+1

r p v C

s+3

2

D2

d

+D2q

LC

+ω2

+ω2

r p v C

.

(7)

Analysis of(6)and(7)reveals that a right-half-plane(RHP) zero appears and the sign of the transfer function changes when the operating point moves from the CV to the CC region of a PVG.This is due to the fact that at MPP,the dynamic resistance of the PVG r pv coincides with the equivalent static loading resistance(i.e.,the static input impedance of the PVIC)accord-ing to the maximum power transfer theorem[18]and(1).The dynamic resistance r pv is greater in magnitude than the static resistance in the CC region(CCR)and smaller in the CV region (CVR)of a PVG,which will change the location of the G co and G co-d zero in the complex plane as presented in(8)and veri?ed by the experimental measurements from three-phase inverter presented in Fig.8

CVR:r pv

MPP:r pv=U in/I in?ωz=0Origin

CCR:r pv>U in/I in?ωz>0RHP.(8) Appearance of the RHP zero and the change of sign of the control-to-output-current transfer function means that the output current control cannot be stable both in the CC and CV regions of a PVG.Therefore,a cascaded control scheme(input-voltage output-current)is needed to enable the operation at all PVG operating points and to transfer maximum power in a reliable manner,as shown in detail in[8]–[10],and[17].The RHP zero in the output-current-control loop will actually turn into an RHP pole in the input-voltage-control loop when the operating point is in the CC region of a PVG.This will naturally cause design constraints in the input-voltage control,as discussed in[19] and[20].

B.DC–DC Interfacing

Fig.9shows a dc–dc converter based on a conventional boost topology with an additional input capacitor.The dc–dc converter can be used as an upstream converter between a PVG and an inverter resulting in a two-stage conversion scheme,as presented in Fig.10.The dc–dc converter is responsible for the maximum-power-point-tracking(MPPT)function by controlling its own input voltage.The VSI-type inverter has a similar cascaded control structure as in the single-stage conversion scheme,thus enabling maximum power transfer.Accordingly,both the dc–dc and the dc–ac converters in PV applications control its own input voltage.Therefore,they must be analyzed as current-fed current-output converters as previously discussed.

Fig.9.Boost-type dc–dc converter with an input capacitor.

Fig.10.Typical two-stage grid interface for a PVG.

The additional dc–dc stage enables the use of less series-connected PV modules compared to the single-stage inverters (see Figs.4and5),which may be bene?cial in case of partial shading conditions[21].The dc–dc stage can also regulate its input voltage to practically pure dc(i.e.,provides perfect power decoupling),which can increase the energy yield compared to single-stage single-phase inverters where the dc power?uctuates at twice the grid frequency[22].

The dynamics of the dc–dc converter,when loaded by a voltage-type load(i.e.,an inverter controlling its input voltage, u o in Fig.9),can be obtained by linearizing the switching-frequency-averaged model presented in[23]and solving the transfer functions between the input and output variables in the frequency domain.

The control-to-input-voltage transfer function for the con-verter in Fig.9without the parasitic elements can be given by

G ci-dc=?

U o

LC1

1

s2+1

r p v C1

s+1

LC1

.(9)

According to(9)and Fig.11,there exist no operating-point-dependent phase shift or zeros that would move between the left and right halves of the complex plane causing control sys-tem design constraints as discussed earlier.The only differ-ence between different PVG operating points is the change in the damping of the resonance of G ci-dc,as can be seen from Fig.11.

The input-voltage control should be designed so that the bandwidth exceeds the MPPT-algorithm execution frequency. In addition,a bandwidth over twice the grid fundamental fre-quency would be bene?cial in single-phase applications in order to prevent the low-frequency dc-link-voltage(i.e.,inverter in-put voltage)ripple from re?ecting to the input terminals of the dc–dc converter and,therefore,to the PVG.

10010

1

10

2

10

3

10

4

?20

2040M a g n i t u d e (d B V )

10

10

1

102103

10

4

?90090

180P h a s e (d e g )

Freq u ency (Hz)

Fig.11.Control-to-input-voltage transfer function.Some researchers claim that the dc–dc converter in the two-stage conversion scheme could be used to control the dc-link voltage [24]–[26],which means that the inverter controls only its output current,because two converters cannot control the same voltage.This control scheme does not work when the intention is to deliver maximum power from the input source without compromising the stability of the system,which will be proven next.The transfer functions presented in [23]can be used to compute the control-to-output-voltage transfer function using the method presented in [27]as

G Z co -dc

=?u o ?d

=?i o /?d ?i o /?u o =G H co

-dc

Y H o -dc (10)

where the superscript “H”denotes an H-parameter model

(current-to-current converter)and “Z”denotes a Z-parameter model (current-to-voltage converter)[28].According to (10),the control-to-output-current and voltage transfer functions share the same zeros and the following analysis is valid for both of the transfer functions.The source-affected control-to-output-voltage transfer function G co -dc can be given according to [23]by

G Z co -dc =

?I i n C 2

s 2

+ 1C 1r p v ?

U i n I i n L

s +

1

C 1L

?

U i n

I i n C 1Lr p v

s 3+

1

C 1r p v

s 2+

C 1

D 2+C 2C 1C 2L

s +

D

C 1C 2Lr p v

.(11)

Analyzing (11)and Fig.12reveals that the transfer function has a low-frequency zero located on the RHP when the PVG is operating at voltages lower than the MPP.Accordingly,the output control (whether output voltage or current)of the inter-facing dc–dc boost converter cannot be designed to be stable at all PVG operating points,because the G co -dc changes its sign between different operating regions and a low-frequency RHP zero appears.

10010

1

10

2

10

3

10

4

?40

?200204060M a g n i t u d e (d B

A )

10

10

1

102103

10

4

?270

?180?90090180P h a s e (d e g )

Freq u ency (Hz)

Fig.12.Control-to-output-voltage transfer function.

This implies that if the output of the dc–dc converter is to be controller,it needs to control also its input.But a cascaded input-voltage output-voltage control scheme for the dc–dc con-verter cannot guarantee proper dc-link voltage for the VSI-type inverter.Also,determining the grid current reference will be problematic.Therefore,it can be concluded that each converter in the power processing chain have to control its input termi-nals if maximum power is to be supplied into the utility grid.In PV applications,the input-current control is prone to saturation,since the MPP current is close to the short-circuit current that is dependent on the irradiation level with relatively fast dynam-ics.The open-circuit voltage,on the other hand,is dependent mostly on the temperature with negligibly slow dynamics;thus,input-voltage control can be realized in a reliable manner [16].Based on the previous analysis regarding dc–ac and dc–dc interfacing,few key points can be outlined:1)the dc–dc con-verter in the two-stage conversion scheme is responsible for the MPPT,where input-voltage control is preferred over the open-loop-based MPPT [23];2)the dc–ac converter has a cas-caded input-voltage output-current control structure both in the single-and two-stage conversion schemes;3)therefore,the dc–dc and dc–ac converters in PV applications have to be analyzed as current-fed current-output converters,where the input cur-rent is the source-side input variable and the input voltage is the source-side output variable;and 4)the practical tests have to be carried out by using input source emulating properly the behavior of real PVG.

IV .E XAMPLE S OLAR A RRAY S IMULATORS

Properties of two different commercial solar array simulators from two different manufacturers were evaluated.Two arti?cial light units were used to illuminate the reference PV modules.The ?rst light unit is a based on ?uorescent lamps and is de-signed to produce radiation intensity of 500W/m 2for a 30-W PV module.The second light unit based on halogen lamps is designed to produced the same intensity for a 190-W PV mod-ule.Both of the modules operate at half the nominal power.The

05

101520

Volta g e (V)

R e s i s t a n c e (d B Ω)

Fig.13.Measured dynamic resistances.

05

101520

Volta g e (V)

C a p a c i t a n c e (d B μF )

Fig.14.Measured dynamic capacitances.

?rst solar array simulator,device A,was evaluated by using the 30-W and 190-W modules as references.The second solar array simulator,device B,was evaluated by using the 190-W module as a reference.

A.30-W Module Emulation

The evaluated commercial power electronic substitute (device A)has three different modes of operation:SAS,table and ?xed modes.In the SAS mode,the simulator is programmed using three reference points:short-circuit current,open-circuit voltage,as well as current and voltage at the MPP.In the table mode,the I –V curve is represented by voltage–current pairs with a limitation that the voltage points must be ascending and the current points descending.In the ?xed mode,a maximum voltage is given and the simulator operates as a voltage limited current source having rectangular I –V curve characteristics.Measured dynamic resistances and capacitances from the commercial PVG and device A are shown in Figs.13and https://www.wendangku.net/doc/c115012618.html,ter on in the ?gures,the device A at the two different

oper-

Volta g e (V)

C u r r e n t (A )

Fig.15.Solar array simulator I –V curve comparison.

ating modes will be referred to as “Table”and “SAS.”Based on r pv of the real PVG,it can be seen that the curve has two distinct slopes.Because r pv is presented in dB ·Ω,it is clear that r pv would be best approximated with a two-diode (i.e.,double exponential)model as opposed to the one-diode model of Fig.1.The same double exponential characteristics are also visible in Fig.14,which presents the measured dynamic capacitances.Based on Fig.13,the device A produces similar double ex-ponential characteristics in respect to r pv when it is used in the table mode.However,the dynamic resistance of the device A used in the SAS mode is constant in the CV region,as can be seen from Fig.13.This indicates that the dynamic resistance of a real PVG can be emulated with higher precision by using the table mode.The operating mode of device A does not affect the emulated dynamic capacitance,as can be seen from Fig.14.The capacitance of the device A is considerably higher (up to 30dB μF higher)than the capacitance of the real PVG and it does not show double exponential characteristics.

Fig.15presents the I –V curves of solar array simulator in SAS and table modes.It was stated earlier that the dynamic resistance of device A in the SAS mode is constant in the CV region.Constant dynamic resistance implies that the I –V curve is a straight line in the CV region,as can be noticed from Fig.15.In the table mode,the device A produces I –V curve correctly,and thus also the dynamic resistance as was analyzed in Section II.It is worth noting that a solar array simulator can produce the dynamic resistance of a PVG correctly only if the simulator produces the I –V curve correctly when loaded with the speci?c power electronic device under test.

Figs.16and 17present step-like load change from CV to CC region so that the power at initial and ?nal operating points is the same.The short-circuit current for the PVG and the device A model was 1.0A.The generator current exceeds the short-circuit current value (which should be impossible based on the static I –V curve)because of the stored energy in the dynamic capacitance.The overshoot is considerably smaller with the real PVG (peak current 1.222A)than with the device A (peak current

100μs

0.5A div

i 5V div

u Fig.16.Load step change in case of the PVG.

100μs

0.5A div

i

5V div

u Fig.17.Load step change in case of the device A in the table mode.

101

10

2

10

3

10

4

10

5

10

6

0204060M a g n i t u d e (d B Ω)

10

110

2

103104

10

5

10

6

?90

?45

04590

P h a s

e (d e g )

Freq u ency (Hz)

Fig.18.Impedance comparison.

1.526A)since the dynamic capacitance of PVG is considerably smaller than that of the device A as discussed earlier.This effect should also be taken into account when validating time-domain behavior of interfacing converters.The high-frequency ripple in PVG current (see Fig.16)is due to the resonant inverters driving the ?uorescent lamp unit.

Figs.13–16compared the PVG and the electronic substitute in terms of r pv ,c pv ,and time-domain responses.Fig.18presents the measured PVG and device A impedances in CC and CV regions of the I –V curve.By considering the impedance in the

10

10

1

10

2

10

3

10

4

?40?20020

4060M a g n i t u d e (d B A )

10

10

1

102103

10

4

?270

?180?90090180P h

a s e (d e g )

Freq u ency (Hz)

Fig.19.Control-to-output current transfer function comparison.

Fig.20.

Boost–buck-type dc–dc converter.

CC region,device A shows PVG-like characteristics but with a higher capacitance up to c.a.2kHz.The impedance in the CV region correlates up to the same frequency range.After the c.a.2-kHz frequency,the device A impedance does not show similar resistive–capacitive characteristics as the real PVG does.

This difference is visible in Fig.19,which presents the mea-sured control-to-output-current transfer function for the con-verter in Fig.9.The measurements are performed at the same operating points as the impedances in Fig.18.It can be con-cluded by considering Figs.18and 19that the low-frequency value of the PVG impedance r pv is the major factor in deter-mining the dynamic properties of the converter connected to a PVG as was discussed in Section III-A.However,if the input capacitance of the converter and the dynamic capacitance of the solar array simulator are in the same order of magnitude or smaller,the considerably higher capacitance of the solar array simulator has to be taken into account.

Figs.3and 18show that the phase of the PVG impedance lies between ±90?.A solar array simulator should have similar passive-circuit-like characteristics,as in Fig.18,in order to be justi?ed as a substitute for the real PVG.B.190-W Module Emulation

The 190-W module and the devices A and B were interfaced with a boost–buck-type dc–dc converter shown in Fig.20,op-erating under input-voltage-feedback control.A low-bandwidth (75Hz)integral controller was used yielding a phase margin of

101

10

2

10

3

10

4

10

5

10

6

?200204060M a g n i t u d e (d B

)

10

110

2

103104

10

5

10

6

?180

0180360540

P h a s e (d e g )

Freq u ency (Hz)

Fig.21.Impedance comparison.

200ms

1A div

i 5V div

u 5V div

u

1A div

i Fig.22.Input-voltage-reference ramp with the PVG.

88?in the input-voltage-control loop.A parallel damping circuit comprising series connection of a capacitor C d and a resistor R d was connected in parallel with the converter input in order to minimize the resonant behavior of the converter.

The measured output impedances of the PVG and the devices A and B are shown in Fig.21.It can be observed that both of the devices reproduce the dynamic resistance accurately (i.e.,low-frequency impedance).The capacitance of the device B is higher than the capacitance of device A,which again is higher than the capacitance of the real PVG,as was the case also earlier.It can be also observed that the phase of the PVG and device A impedances lies between ±90?within the whole operating region,as in Fig.18.The phase of the device B impedance is similar to the CC region.However,the behavior of the device B changes dramatically when the operating point moves to the CV region.A resonance with 270?phase shift occurs approximately at 250Hz,which can lead to impedance-based stability problems when the interfacing converter is connected.

It is known that the stability and load interaction issues in a voltage-fed system can be studied by applying Nyquist stability criterion to the impedance ratio of the load and source subsys-tems known as minor-loop gain (Z o /Z in )[29].In current-fed systems,the stability is studied based on inverse minor-loop gain

200ms

1A div

i 5V div

u 5V div

u 1A div

i Fig.23.Input-voltage-reference ramp with the device A.

10110

2

10

3

10

4

?20

20

40

M a g n i t u d e (d B Ω)

10

1

10

2

10

3

10

4

?90090180270360450P h a s e (d e g )

Freq u

ency (Hz)

Fig.24.Input impedance of the converter and output impedance of the device

B.

(Z in /Z o )[30].If the impedance ratio of an interconnected stable source and load subsystems does not satisfy the Nyquist stabil-ity criterion,the interconnected system is unstable.It can be deduced that the stability criterion will be violated in a PV sys-tem if |Z in /Z o |≥1,while the phase difference exceeds 180?.The concept of minor-loop gain is typically used to study grid interactions between the inverters and the utility grid [6],but applies also in the PVG/converter interface.

A triangular input-voltage-reference ramp sweeping the op-erating points between the CC and CV regions was applied in the control system of the converter in Fig.20.In Figs.22and 23,the ramp was applied with the PVG and device A.As can be seen,the system is stable within the whole operating range and the reference ramp is reproduced nicely.This is due to the fact that both the source and load impedance (the converter in-put impedance is shown in Fig.24)phase lies between ±90?.Accordingly,a phase difference of 180?,and thus,violation of the stability criterion does not take place.

200ms 1A div

i 5V div

u

5V div

u

1A div

i

Fig.25.Input-voltage-reference ramp with the device B.

Fig.24shows the converter input impedance Z in and the output impedance of the device B Z o-B in the CC and CV regions.The magnitude of the converter input impedance exceeds the source impedance magnitude after100Hz in the CV region;thus,instability is predicted to occur in the CV region since phase difference of180?is found at a higher frequency.A frequency range is found where Z in>Z o also in the CC region,but a phase difference of180?does not exist, indicating stable operation in the CC region.This information is veri?ed in the time domain in Fig.25.It can be seen that the system is stable in the CC region but oscillates at the CV region when the same input-voltage-reference ramp was applied,as shown in Figs.22and23.

V.C ONCLUSION

In this paper,the properties of a PV generator have been analyzed analytically and with experimental measurements.A PV generator is internally a power-and voltage-limited non-linear current source having both CC-and CV-like properties depending on the operating point.The dynamic properties of the generator,which include the dynamic resistance and capac-itance,are also operating-point-dependent nonlinear quantities. The dynamic resistance of a PV generator has profound ef-fects on dynamic behavior of the interfacing converter.The dynamic resistance is known to equal the static resistance at the MPP.The current-and voltage-source properties of the PV generator can also be justi?ed by considering the dynamic re-sistance.The dynamic resistance is greater in magnitude than the static resistance in the current region and lower in magni-tude in the voltage region.This property moves operating-point-dependent zeros and poles in the converter dynamics between the right and left halves of the complex plane according to the operating point of the PV generator.The appearance of RHP zeros and poles and their effect on the control dynamics of PV converters are important to be taken into account if robust and stable PV power systems are to be designed.

Key points for the analysis,design,and testing of PV con-verters can be summarized as follows:1)in order to transfer maximum power,an input-side variable(current or voltage) must be controlled,or the converter has to operate at open loop;

2)input-voltage-feedback control is the most feasible method to control a PV converter;3)in case of input-voltage-controlled converter,the converter must be analyzed in such a way that it is fed by a current source;and4)the nonideal PV generator source impedance has to be considered because of its profound effect on the interfacing converter dynamics.

A real PV generator is usually replaced with a power elec-tronic substitute,known as a solar array simulator,so that time-invariant and controlled testing conditions can be guaranteed in the converter validation process without the need to invest in a large PV power plants.This paper also quali?ed two com-mercial solar array simulators as an example in terms of the de?ned dynamic properties and analyzed the differences both in time and frequency domains between the substitutes and real PV generators.

The measured substitutes were shown to reproduce the dy-namic resistance accurately although the dynamic capacitances were considerably higher and did not show similar properties as the PV generator capacitance.It was also noticed that in order to reproduce the PV generator characteristics with the high-est precision,the I–V curve of the electronic substitute should be programmed using several current–voltage pairs if possible. The output impedance of one of the substitutes was such that it made the solar array simulator/converter interface unstable. The properties of electronic substitutes should always be tested properly so that the same converter dynamics is reproduced with the substitute and the real PV generator.

Based on the investigations presented in this paper,the most important properties the solar array simulator shall have in order to properly emulate a real PVG can be summarized as follows: 1)The low-frequency impedance,i.e.,the dynamic resistance and the I–V curve have to be emulated as accurately as possible.

2)The dynamic capacitance should be also emulated accurately enough though it is not as important as the emulation of the dynamic resistance.The capacitance of the simulators are typi-cally higher than the capacitance of the PV generator.This can affect the behavior of the converters having small input capaci-tor.3)The real PV generator shows passive-circuit-like behav-ior,which means that the phase of its output impedance stays within±90?.The emulator has to follow the same behavior.

R EFERENCES

[1] B.K.Bose,“Global warming:Energy,environmental pollution,and the

impact of power electronics,”IEEE Ind.Electron.Mag.,vol.4,no.1, pp.6–17,Mar.2010.

[2]M.A.Eltawil and Z.Zhao,“Grid-connected photovoltaic power systems:

technical and potential problems:A review,”Renew.Sust.Energy Rev., vol.14,no.1,pp.112–129,Jan.2010.

[3]G.Petrone,G.Spagnuolo,R.Teodorescu,M.Veerachary,and M.Vitelli,

“Reliability issues in photovoltaic power processing systems,”IEEE Trans.Ind.Electron.,vol.55,no.7,pp.2569–2580,Jul.2008.

[4]J.H.R.Enslin and P.J.M.Heskes,“Harmonic interaction between a

large number of distributed power inverters and the distribution network,”

IEEE Trans.Power Electron.,vol.19,no.6,pp.1586–1593,Nov.2004.

[5]M.Cespedes and J.Sun,“Modeling and mitigation of harmonic resonance

between wind turbines and the grid,”in Proc.IEEE Energy Convers.

Congr.Expo.,Phoenix,AZ,Sep.2011,pp.2109–2116.

[6]J.Sun,“Impedance-based stability criterion for grid-connected inverters,”

IEEE Trans.Power Electron.,vol.26,no.11,pp.3075–3078,Nov.2011.

[7]M.Cespedes and J.Sun,“Renewable energy systems instability involving

grid-parallel inverters,”in Proc.24th Annu.IEEE Appl.Power Electron.

Conf.Expo.,Palm Springs,CA,Feb.2009,pp.1971–1977.

[8]T.Suntio,J.Huusari,and J.Lepp¨a aho,“Issues on solar-generator inter-

facing with voltage-fed MPP-tracking converters,”EPE J.,vol.20,no.3, pp.40–47,Sep.2010.

[9]T.Suntio,J.Lepp¨a aho,J.Huusari,and L.Nousiainen,“Issues on solar-

generator interfacing with current-fed MPP-tracking converters,”IEEE Trans.Power Electron.,vol.25,no.9,pp.2409–2419,Sep.2010. [10]J.Puukko,T.Messo,and T.Suntio,“Effect of photovoltaic generator

on a typical VSI-based three-phase grid-connected photovoltaic inverter dynamics,”in Proc.IET Renewable Power Generation Conf.,Edinburgh, U.K.,Sep.2011,pp.1–6.

[11]S.Liu and R.A.Dougal,“Dynamic multiphysics model for solar array,”

IEEE Trans.Energy Convers.,vol.17,no.2,pp.285–294,Jun.2002. [12]M.G.Villalva,J.R.Gazoli,and E.R.Filho,“Comprehensive approach

to modeling and simulation of photovoltaic arrays,”IEEE Trans.Power Electron.,vol.24,no.5,pp.1198–1208,May2009.

[13] D.Chenvidhya,K.Kirtikara,and C.Jivacate,“PV module dynamic

impedance and its voltage and frequency dependencies,”Sol.Energy Mater.Sol.Cells,vol.86,no.2,pp.243–251,Mar.2005.

[14] A.M¨a ki,S.Valkealahti,and T.Suntio,“Dynamic terminal characteristics

of a photovoltaic generator,”in Proc.14th Int.Power Electron.Motion Control Conf.,Ohrid,Macedonia,Sep.2010,pp.T12-76–T12-80. [15]J.Thongrpon,K.Kirtikara,and C.Jivacate,“A method for the determina-

tion of dynamic resistance of photovoltaic modules under illumination,”

Sol.Energy Mater.Sol.Cells,vol.90,no.18–19,pp.3078–3084,Nov.

2006.

[16]W.Xiao,W.G.Dunford,P.R.Palmer,and A.Capel,“Regulation of

photovoltaic voltage,”IEEE Trans.Ind.Electron.,vol.54,no.3,pp.1365–1374,Jun.2007.

[17]L.Nousiainen,J.Puukko,and T.Suntio,“Simple VSI-based single-phase

inverter:dynamical effect of photovoltaic generator and multiplier-based grid synchronization,”in Proc.IET Renewable Power Generation Conf., Edinburgh,U.K.,Sep.2011,pp.1–6.

[18]J.Wyatt and L.Chua,“Nonlinear resistive maximum power theorem,

with solar cell application,”IEEE Trans.Circuits Syst.,vol.30,no.11, pp.824–828,Nov.1983.

[19]L.Nousiainen and T.Suntio,“Dc-link voltage control of a single-phase

photovoltaic inverter,”in Proc.6th IET Int.Conf.Power Electron.,Mach.

Drives,Bristol,U.K.,Mar.2012,pp.1–6.

[20]J.Puukko,L.Nousiainen,and T.Suntio,“Effect of minimizing input

capacitance in VSI-based renewable energy source converters,”in Proc.

33rd IEEE Int.Telecommun.Energy Conf.,Amsterdam,The Netherlands, Oct.2011,pp.1–9.

[21] A.M¨a ki and S.Valkealahti,“Power losses in long string and parallel-

connected short strings of series-connected silicon-based photovoltaic modules due to partial shading conditions,”IEEE Trans.Energy Con-vers.,vol.27,no.1,pp.173–183,Mar.2012.

[22]J.-F.Wu,C.-H.Chang,L.-C.Lin,and C.-L.Kuo,“Power loss comparison

of single-and two-stage grid connected photovoltaic systems,”IEEE Trans.Energy Convers.,vol.26,no.2,pp.707–715,Jun.2011.

[23]T.Messo,J.Puukko,and T.Suntio,“Effect of MPP-tracking dc/dc con-

verter on VSI-based photovoltaic inverter dynamics,”in Proc.6th IET Int.

Conf.Power Electron.,Mach.Drives,Bristol,U.K.,Mar.2012,pp.1–6.

[24]Y.-H.Liao and https://www.wendangku.net/doc/c115012618.html,i,“Newly-constructed simpli?ed single-phase

multistring multilevel inverter topology for distributed energy resources,”

IEEE Trans.Power Electron.,vol.26,no.9,pp.2386–2392,Sep.2011.

[25]S.Vighetti,J.-P.Ferrieux,and Y.Lembeye,“Optimization and design

of a cascaded dc/dc converter devoted to grid-connected photovoltaic systems,”IEEE Trans.Power Del.,vol.27,no.4,pp.2018–2027,Apr.

2012.

[26]J.-M.Kwon,K.-H.Nam,and B.-H.Kwon,“Photovoltaic power condi-

tioning system with line connection,”IEEE Trans.Ind.Electron.,vol.53, no.4,pp.1048–1054,Aug.2006.

[27]J.Lepp¨a aho,L.Nousiainen,J.Puukko,J.Huusari,and T.Suntio,“Imple-

menting current-fed converters by adding an input capacitor at the input of voltage-fed converter for interfacing solar generator,”in Proc.14th Int.Power Electron.Motion Control Conf.,Ohrid,Macedonia,Sep.2010, pp.T12-81–T12-88.

[28] C.K.Tse,Linear Circuit Analysis.Edinburgh,UK:Addison Wesley

Longman,1998,p.307.

[29]R.D.Middlebrook,“Input?lter considerations in design and applications

of switching regulators,”in Proc.IEEE Ind.Appl.Soc.Annu.Meeting Rec.,Chicago,IL,Oct.1976,pp.366–382.

[30]J.Lepp¨a aho,J.Huusari,L.Nousiainen,J.Puukko,and T.Suntio,“Dy-

namic properties and stability assessment of current-fed converters in pho-tovoltaic applications,”IEEJ Trans.Ind.Appl.,vol.131,no.8,pp.976–984,Aug.

2011.

Lari Nousiainen(S’09)was born in Nurmes,

Finland,in1984.He received the M.Sc.(Tech)degree

in electrical engineering from the Tampere Univer-

sity of Technology,Tampere,Finland,in2009.He is

currently working toward the Ph.D.degree in the De-

partment of Electrical Energy Engineering,Tampere

University of Technology.He completed writing his

doctorate thesis on the analysis and design of grid-

tied photovoltaic inverters in June2012.

In July2012,he started working at ABB Drives

in Helsinki,Finland,as a Design Engineer.

Dr.Nousiainen is a Member of the IEEE Power Electronics Society,the IEEE Industrial Electronics Society,and the IEEE Power and Energy

Society.

Joonas Puukko(S’10)was born in Helsinki,Finland,

in1983.He received the M.Sc.(Tech.)degree(with

distinction)in electrical engineering from the Tam-

pere University of Technology,Tampere,Finland,in

2008,where he also received the Ph.D.degree from

the Department of Electrical Energy Engineering.He

completed writing his doctorate thesis in May2012.

In July2012,he started working at ABB Drives

in Helsinki,Finland,as a Design Engineer.His re-

search interests included power electronics,three-

phase dc/ac power supplies,dynamic modeling,and interfacing of renewable energy systems.

Dr.Puukko is a Member of the IEEE Power Electronics Society,the IEEE Industrial Electronics Society,and the IEEE Power and Energy

Society.

Anssi M¨a ki(S’09)was born in Kauhava,Finland,

1985.He received the M.Sc.(Tech.)degree in electri-

cal engineering from the Tampere University of Tech-

nology,Tampere,Finland,in2010,where he has been

working toward the Ph.D.degree in the Department

of Electrical Energy Engineering as a Researcher.

His current research interests include the operation

of photovoltaic power generators and the develop-

ment of maximum-power-point-tracking algorithms.

Mr.M¨a ki is a Member of the IEEE Power and

Energy

Society.

Tuomas Messo(S’11)was born in Helsinki,Finland,

in1985.He received the M.Sc.(Tech.)degree in

electrical engineering from the Tampere University

of Technology,Tampere,Finland,in2011,where he

is currently working toward the Ph.D.degree in the

Department of Electrical Energy Engineering,as a

Researcher.

His research interests include power electronics,

three-phase dc/ac power supplies,dynamic modeling,

control design,and interfacing of photovoltaic energy

systems.

Juha Huusari(S’09)received the M.Sc.(Tech.)

degree in electrical engineering from the Tampere

University of Technology,Tampere,Finland,in2009.

He is currently working toward the Ph.D.degree in

the Department of Electrical Energy Engineering,

Tampere University of Technology.

As of August2012,he will be with ABB Corporate

Research in Baden-D¨a ttwil,Switzerland,working as

a Scientist with photovoltaic electricity systems.He

has authored and co-authored12conference publica-

tions and?ve journal publications.He also has one

international patent application.His current research interests include analy-

sis and design of distributed maximum-power-point-tracking dc–dc converters,

issues related to interfacing of photovoltaic generators,as well as practical

switching-power-supply design issues.

Dr.Huusari is a Member of the IEEE Power Electronics Society,the IEEE

Industrial Electronics Society,and the IEEE Power Engineering

Society.

Juha Jokipii(S’11)received the M.Sc.(Tech.)

degree in electrical engineering from the Tam-

pere University of Technology,Tampere,Finland,

in2011,where he is currently working toward the

Ph.D.degree in the Department of Electrical Energy

Engineering.

His research interests include power electronics,

three-phase dc/ac power supplies,dynamic model-

ing,and interfacing of renewable energy

systems.

Jukka Viinam¨a ki received the B.Sc.(Tech.)degree

in embedded systems from the Tampere University of

Applied Sciences,Tampere,Finland,in2009.He is

currently working toward the M.Sc.in electrical en-

gineering at the Tampere University of Technology.

Since2012,he has been a Research Assistant in the

Department of Electrical Energy Engineering,Tam-

pere University of Technology.His research interests

include dc/dc converters and dc/ac inverters in pho-

tovoltaic

applications.

Diego Torres Lobera(S’10)was born in Palma

de Mallorca,Spain,in1985.He received the M.Sc.

degree in industrial engineering from the University

of Zaragoza,Zaragoza,Spain,in2010.

Since the beginning of2011,he has been a

Researcher with the Department of Electrical Energy

Engineering,Tampere University of Technology,

Tampere,Finland.His current research interests in-

clude operation and modeling of photovoltaic power

generators and maximum-power-point-tracking

techniques.

Seppo Valkealahti(M’10)was born in Alavus,

Finland,1955.He received the M.Sc.and Ph.D.de-

grees in physics from the University of Jyv¨a skyl¨a,

Jyv¨a skyl¨a,Finland,in1983and1987,respectively.

From1982to1997,he was a Teacher and Re-

searcher of physics at the University of Jyv¨a skyl¨a,in

the Riso National Laboratory in Denmark,and in the

Brookhaven National Laboratory in NY.From1997

to2004,he worked in ABB heading research and

product development activities.In the beginning of

2004,he joined the Tampere University of Technol-

ogy,Tampere,Finland,where he is currently a Professor in the Department of

Electrical Energy Engineering.His research interests include electric-power-

production-and consumption-related technologies,solar energy,and multisci-

enti?c problems related to power engineering.

Prof.Valkealahti is a Member of the IEEE Power and Energy

Society.

Teuvo Suntio(M’98–SM’08)received the M.Sc.

(Tech)and D.Sc.(Tech)degrees in electrical engi-

neering from the Helsinki University of Technology,

Espoo,Finland,in1981and1992,respectively.

From1977to1991,he worked at Fiskars Power

Systems as a Design Engineer and R&D Manager.

From1991to1992,he worked at Ascom Eergy Sys-

tems Oy as an R&D Manager.From1992to1994,he

was an entrepreneur in power electronics design con-

sultancy,and from1994to1998he worked at Efore

Oyj as a Consultant and Project Manager.Since1998,

he has been a Professor specializing in switched-mode power converter tech-

nologies?rst at the University of Oulu,Electronics Laboratory,and from August

2004in the Department of Electrical Energy Engineering,Tampere University

of Technology,Tampere,Finland.He holds several international patents and has

authored about180international scienti?c journal and conference papers,the

book Dynamic Pro?le of Switched-Mode Converter—Modeling,Analysis and

Control(Weinhein,Germany:Wiley-VCH,2009)as well as two book chapters.

His current research interests include dynamic modeling,control design,opti-

mal electromagnetic interference design of switched-mode power converters,as

well as interfacing of renewable energy sources.

Prof.Suntio is a Member of the IEEE Power Electronics Society,the IEEE

Industrial Electronics Society,and the IEEE Circuits and Systems Society as

well as a Member of the European Power Electronics and Drives Association.

From the beginning of2010,he has served as an Associate Editor for the IEEE

T RANSACTION ON P OWER E LECTRONICS.He has also served as a Guest Editor-

In-Chief of the special issue on power electronics in photovoltaic applications

in the IEEE T RANSACTION ON P OWER E LECTRONICS.

Sql日期时间格式转换

Sql日期时间格式转换 sql server2000中使用convert来取得datetime数据类型样式(全) 日期数据格式的处理,两个示例: CONVERT(varchar(16), 时间一, 20) 结果:2007-02-01 08:02/*时间一般为getdate()函数或数据表里的字段*/ CONVERT(varchar(10), 时间一, 23) 结果:2007-02-01 /*varchar(10)表示日期输出的格式,如果不够长会发生截取*/ 语句及查询结果: Select CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06 Select CONVERT(varchar(100), GETDATE(), 2): 06.05.16 Select CONVERT(varchar(100), GETDATE(), 3): 16/05/06 Select CONVERT(varchar(100), GETDATE(), 4): 16.05.06 Select CONVERT(varchar(100), GETDATE(), 5): 16-05-06 Select CONVERT(varchar(100), GETDATE(), 6): 16 05 06 Select CONVERT(varchar(100), GETDATE(), 7): 05 16, 06 Select CONVERT(varchar(100), GETDATE(), 8): 10:57:46 Select CONVERT(varchar(100), GETDATE(), 9): 05 16 2006 10:57:46:827AM Select CONVERT(varchar(100), GETDATE(), 10): 05-16-06 Select CONVERT(varchar(100), GETDATE(), 11): 06/05/16 Select CONVERT(varchar(100), GETDATE(), 12): 060516 Select CONVERT(varchar(100), GETDATE(), 13): 16 05 2006 10:57:46:937 Select CONVERT(varchar(100), GETDATE(), 14): 10:57:46:967 Select CONVERT(varchar(100), GETDATE(), 20): 2006-05-16 10:57:47 Select CONVERT(varchar(100), GETDATE(), 21): 2006-05-16 10:57:47.157 Select CONVERT(varchar(100), GETDATE(), 22): 05/16/06 10:57:47 AM Select CONVERT(varchar(100), GETDATE(), 23): 2006-05-16 Select CONVERT(varchar(100), GETDATE(), 24): 10:57:47 Select CONVERT(varchar(100), GETDATE(), 25): 2006-05-16 10:57:47.250 Select CONVERT(varchar(100), GETDATE(), 100): 05 16 2006 10:57AM Select CONVERT(varchar(100), GETDATE(), 101): 05/16/2006

js日期时间格式验证,时间比较

日期时间脚本库方法列表 Date.prototype.isLeapYear 判断闰年 Date.prototype.Format 日期格式化 Date.prototype.DateAdd 日期计算 Date.prototype.DateDiff 比较日期差 Date.prototype.toString 日期转字符串 Date.prototype.toArray 日期分割为数组 Date.prototype.DatePart 取日期的部分信息 Date.prototype.MaxDayOfDate 取日期所在月的最大天数 Date.prototype.WeekNumOfYear 判断日期所在年的第几周 StringToDate 字符串转日期型 IsValidDate 验证日期有效性 CheckDateTime 完整日期时间检查 daysBetween 日期天数差 js 代码 //--------------------------------------------------- // 判断闰年 //--------------------------------------------------- Date.prototype.isLeapYear = function() { return (0==this.getYear()%4&&((this.getYear()%100!=0)||(this.getYear()%400==0))); } //--------------------------------------------------- // 日期格式化 // 格式 YYYY/yyyy/YY/yy 表示年份 // MM/M 月份 // W/w 星期 // dd/DD/d/D 日期 // hh/HH/h/H 时间 // mm/m 分钟 // ss/SS/s/S 秒 //--------------------------------------------------- Date.prototype.Format = function(formatStr) { var str = formatStr; var Week = ['日','一','二','三','四','五','六'];

Mysql格式化日期时间

DATE_FORMAT(date,format) 根据format字符串格式化date值。下列修饰符可以被用在format 字符串中:%M 月名字(January……December) %W 星期名字(Sunday……Saturday) %D 有英语前缀的月份的日期(1st, 2nd, 3rd, 等等。) %Y 年, 数字, 4 位 %y 年, 数字, 2 位 %a 缩写的星期名字(Sun……Sat) %d 月份中的天数, 数字(00……31) %e 月份中的天数, 数字(0……31) %m 月, 数字(01……12) %c 月, 数字(1……12)

%b 缩写的月份名字(Jan……Dec) %j 一年中的天数(001……366) %H 小时(00……23) %k 小时(0……23) %h 小时(01……12) %I 小时(01……12) %l 小时(1……12) %i 分钟, 数字(00……59) %r 时间,12 小时(hh:mm:ss [AP]M) %T 时间,24 小时(hh:mm:ss) %S 秒(00……59)

%s 秒(00……59) %p AM或PM %w 一个星期中的天数(0=Sunday ……6=Saturday )%U 星期(0……52), 这里星期天是星期的第一天 %u 星期(0……52), 这里星期一是星期的第一天 %% 一个文字“%” %a - 星期几的简写 %A - 星期几的全写 %b - 月份的简写

%B - 月份的全写 %c - 日期时间06/12/05 11:15:10 %C - 世纪时间 %d - 一个月的第几号(从01 到31) %D - 同%m/%d/%y %e - 一个月的第几号,号为单数则前面加一空格(从1 到31) %g - 世纪

如何在excel中设置日期时间格式

excel中日期时间格式转换问题 1.2009/05/15 如何转换为20090515这种数字格式。 2.23:03:00 如何转换为230300这种数字格式。 谢谢。 2009/05/15 如何转换为20090515这种数字格式 先选中该列或该单元格,鼠标右击,“设置单元格格式”,“数字”,“自定义”,在类型处输入 yyyymmdd 确定 23:03:00 如何转换为230300这种数字格式。 先选中该列或该单元格,鼠标右击,“设置单元格格式”,“数字”,“自定义”,在类型处输入 hhmmss 确定 在excel列中设置好了日期的格式yyyy-m,为何输入的是20049,却变成1956-10-而且这列中的每行都是这样? 1, 你输入的20049本身不是日期格式,你应该输入2004/09/01 那么,显示为:2004-9 2,你设置为特殊格式0000-00,你输入时输入:200409 将会显示为:2004-09 (月份考虑2位) 如何在excel中设置日期格式 比如:一列的数据是2008.04.29,令一列是2008.05.29,我想求两个日期的天数,但在设置日期格式为2008-4-29时没有反应,是不是这种格式的时间不能设置成日期的格式啊? 2008-4-9 2008-5-9 然后选择设置单元格格式-数字-日期-示例里面选择你需要显示日期的格式 如何设置excel中的日期格式 右键---设置单元格式---数字---自定义---类型中将“yyyy-m-d”修改为“yyyymmdd”,确定。 如何在excel表格中的某一单元格设置日期格式.如果输入的不是日期格式就会出错

excel中如何将时间日期格式转换为日期时间格式

[求助]excel中如何将时间日期格式转换为日期/时间格式 在excel中如何将时间日期格式通过公式转换为日期/时间格式,可以利用转换后的时间格式进行排序或筛选等操作.如:要将"2000-01-01 12:00"转为"2000-01-01" 和"12:00"具体公式如何写,请各高手 帮忙.在此谢过大家了! 我习惯使用: 日期在A1 日期:=TEXT(A1,"yyyy-mm-dd") 时间:=TEXT(A1,"H:MM:SS") 下面方法管用: 复制空白单元格-选中b3:e8-选择性粘贴(加) 然后设置单元格格式类型-日期 最好谜底:没有最好谜底其它回覆1:你可以清空格局从头配备布置其它回覆2:选重所有单位格,从头配备布置啊其它回覆3:综合上面所说的,在可以举行“选择性粘附”的环境下,选择粘附“数据”,要不就是先复制已往,之后从头配备布置格局 需要别人解答的题目:我的1个陈诉中需要大量假座外来数据,我需要在Excel表格中患上到yyyyxmmxdd hh:mm:ss格局,我已配备布置好单位格格局而外来数据的有时候格局为ddxmmxyyyy hh:mm:ss格局,有时候为yyyyxmmxdd hh:mm:ss,哪位大侠帮助告诉我一下怎么措置惩罚备注:单位格我已配备布置成yyyyxmmxdd hh:mm:ss格局,可是把ddxmmxyyyy hh:mm:ss格局日子复制粘附后,照旧只能预示成ddxmmxyyyy hh:mm:ss格局测验考试了数据分列,也没生效用(很快的啊)其它回覆4:照旧不清晰的话,就把例题发过来让我尝

尝看,再发给你ZYLHLB@126 其它回覆5:ddxmmxyyyy hh:mm:ss格局的数据可以用底下的公式转换规范的日子时间格局:=TEXT(DA TE(MID(A1,FIND("#",SUBSTITUTE(A1,"x","#",2))+1,4),MID(A1,FIND("x",A1 )+1,FIND("#",SUBSTITUTE(A1,"x","#",2))-FIND("x",A1)-1),REPLACE(A1,FIND("x",A1),LE N(A1),""))+RIGHT(A1,LEN(A1)-FIND(" ",A1)),"yyyyxmmxdd hh:mm:ss") 判断两种数据格局很简略呀只需判断熬头个x号在第几位就能够了呀=if(find("x",A1)<4,上面所说的公式,A1) 完备公式:=IF(FIND("x",A1)<4,TEXT(DA TE(MID(A1,FIND("#",SUBSTITUTE(A1,"x","#",2))+1,4),M ID(A1,FIND("x",A1)+1,FIND("#",SUBSTITUTE(A1,"x","#",2))-FIND("x",A1)-1),REPLACE(A 1,FIND("x",A1),LEN(A1),""))+RIGHT(A1,LEN(A1)-FIND(" ",A1)),"yyyyxmmxdd hh:mm:ss"),A1) 其它回覆6:我也想学其它回覆7:粘附日子时,要用选择性粘附中的“粘附数据”,之后再同一配备布置日子格局就好了增补:要是你是从另外1个EXCEL表格中复制的时间数据,应该在同1个EXCEL主步伐下打开,不然“选择性粘附-粘附数据”特殊情况不可功别的,你也能够把这个数据先粘附到1个TXT的文这篇文章件中,再复制到EXCEL中其它回覆8:要是你已配备布置好单位格为yyyyxmmxdd hh:mm:ss的格局,那末你输入的话必然要输入完备的日子粒时间x好比:2010-06-12 15:33:22 excel 日期时间格式转换excel日期格式转换来自彩新时尚网

使用fmt标签格式化输出日期和数字

JSTL fmt数字日期格式化 标签用于根据设定的区域将数据格式化输出; 标签用于格式化输出日期和时间; 标签用于把字符串类型的日期和时间转换成日期型数据类型; 标签用于设定默认的时区; 标签用于设定在本签体内有效的时区; 日期格式数据在jsp页面显示使用如下标签 其中${date}是实际数据中的java.util.Date类型数据 pattern="yyyy-MM-dd" 中的"yyyy-MM-dd"按照标准时间格式字符串定义即可, 可以显示到时分秒即为"yyyy-MM-dd HH:mm:ss"注意其中大小写 数字标签 其中${num}是任意的基础数据类型数据,pattern指定当前数字的格式,可以指定格式”#” (只有整数类型)、”#.#”(带一位小数类型)、” ¥#,###.###”(带千位分割符,和“¥”类型)等等;type指定当前数字的类型,type有number(数值)、currency(货币)、percent(百分数)三种; 数字标签实例 Double num = new Double("123456789012.3456"); 整数带千分符显示: 整数显示: 两位小数舍入显示:

DELPHI获得系统当前时间日期和格式化时间

获得系统当前时间 本例中主要应用了FormatDateTime函数,此函数主要用于将日期时间格式化为指定的字符串。利用该函数可以输出许多形式的时间格式。 程序运行结果如图6.1所示 主要代码如下: procedure TForm1.Button1Click(Sender: TObject); begin Label1.Caption := FormatDateTime('hh:nn:ss',Now()); end; 获得系统当前日期 当用户单击窗体中的按钮时,程序会利用DateTimeToStr函数将当前日期转换为一个字符串显示在标签上。 程序运行结果如图6.2所示。 图6.2 获得系统当前日期 主要代码如下: procedure TForm1.Button1Click(Sender: TObject); begin Label1.Caption := DateTimeToStr(Date()); end; 将日期时间格式化为指定格式 本例将日期时间格式化为指定格式主要是应用了FormatDateTime函数。使用该函数可以将当前日期时间格式化为自定义格式。 程序运行结果如图6.3所示。

图6.3 将日期时间格式化为指定格式 主要代码如下: procedure TForm1.Timer1Timer(Sender: TObject); begin Label1.Caption := DateTimeToStr(now()); end; procedure TForm1.Button1Click(Sender: TObject); begin Label2.Caption := FormatDateTime('yyyy年mm月dd日hh时nn分ss秒',now()); end;

Java日期格式大全

日期和时间模式 日期和时间格式由日期和时间模式字符串指定。在日期和时间模式字符串中,未加引号的字母'A'到'Z'和'a'到'z'被解释为模式字母,用来表示日期或时间字符串元素。文本可以使用单引号(')引起来,以免进行解释。"''"表示单引号。所有其他字符均不解释;只是在格式化时将它们简单复制到输出字符串,或者在解析时与输入字符串进行匹配。 定义了以下模式字母(所有其他字符'A'到'Z'和'a'到'z'都被保留): 字 母 日期或时间元素表示示例 G Era标志符Text AD M年中的月份Month July;Jul;07 W月份中的周数Number2 d月份中的天数Number10 E星期中的天数Text Tuesday;Tue H一天中的小时数(0-23)Number0 K am/pm中的小时数 (0-11) Number0 m小时中的分钟数Number30 S毫秒数Number978 Z时区RFC822time zone -0800

示例 以下示例显示了如何在美国语言环境中解释日期和时间模式。给定的日期和时间为美国太平洋时区的本地时间2001-07-0412:08:56。 日期和时间模式结果 "yyyy.MM.dd G'at'HH:mm:ss z"2001.07.04AD at12:08:56PDT "EEE,MMM d,''yy"Wed,Jul4,'01 "h:mm a"12:08PM "hh'o''clock'a,zzzz"12o'clock PM,Pacific Daylight Time "K:mm a,z"0:08PM,PDT "yyyyy.MMMMM.dd GGG hh:mm aaa"02001.July.04AD12:08PM "EEE,d MMM yyyy HH:mm:ss Z"Wed,4Jul200112:08:56-0700 "yyMMddHHmmssZ"010*********-0700 "yyyy-MM-dd'T'HH:mm:ss.SSSZ"2001-07-04T12:08:56.235-0700 同步 日期格式是不同步的。建议为每个线程创建独立的格式实例。如果多个线程同时访问一个格式,则它必须是外部同步的。

时间格式转化

我们经常会遇到对时间进行转换,达到不同的显示效果,默认格式为:2006-6-6 14:33:34 如果要换成成200606,06-2006,2006-6-6或更多的格式该怎么办呢? 这里将要用到:DateTime.ToString的方法(String, IFormatProvider) 示例: using System; using System.Globalization; String format="D"; DateTime date=DataTime.Now; Response.Write(date.ToString(format, DateTimeFormatInfo.InvariantInfo)); 结果输出 Thursday, June 16, 2006 在这里列出了参数format格式详细用法 ======================= 格式字符关联属性/说明 d ShortDatePattern D LongDatePattern f 完整日期和时间(长日期和短时间) F FullDateTimePattern(长日期和长时间) g 常规(短日期和短时间) G 常规(短日期和长时间) m、M MonthDayPattern r、R RFC1123Pattern s 使用当地时间的SortableDateTimePattern(基于ISO 8601) t ShortTimePattern T LongTimePattern u UniversalSortableDateTimePattern 用于显示通用时间的格式 U 使用通用时间的完整日期和时间(长日期和长时间) y、Y YearMonthPattern 下表列出了可被合并以构造自定义模式的模式 ======================================== 这些模式是区分大小写的;例如,识别“MM”,但不识别“mm”。如果自定义模式包含空白字符或用单引号括起来的字符,则输出字符串页也将包含这些字符。未定义为格式模式的一部分或未定义为格式字符的字符按其原义复制。 格式模式说明: d 月中的某一天。一位数的日期没有前导零。 dd 月中的某一天。一位数的日期有一个前导零。 ddd 周中某天的缩写名称,在AbbreviatedDayNames 中定义。 dddd 周中某天的完整名称,在DayNames 中定义。 M 月份数字。一位数的月份没有前导零。 MM 月份数字。一位数的月份有一个前导零。 MMM 月份的缩写名称,在AbbreviatedMonthNames 中定义。 MMMM 月份的完整名称,在MonthNames 中定义。 y 不包含纪元的年份。如果不包含纪元的年份小于10,则显示不具有前导零的年份。 yy 不包含纪元的年份。如果不包含纪元的年份小于10,则显示具有前导零的年份。 yyyy 包括纪元的四位数的年份。 gg 时期或纪元。如果要设置格式的日期不具有关联的时期或纪元字符串,则忽略该模式。

oracle数据库中日期格式化

向oracle数据库中添加格式化的日期, 1.字符到日期操作,用到to_date SimpleDateFormatdateformate = new SimpleDateFormat("yyyy-MM-dd"); String createTime = "to_date('"+dateformate.format(new Date())+"','yyyy-mm-dd')"; 2.日期到字符操作,用到to_char selectsysdate,to_char(sysdate,’yyyy-mm-dd hh24:mi:ss’) from dual selectsysdate,to_char(sysdate,’yyyy-mm-ddhh:mi:ss’) from dual selectsysdate,to_char(sysdate,’yyyy-dddhh:mi:ss’) from dual selectsysdate,to_char(sysdate,’yyyy-mm iw-d hh:mi:ss’) from dual 3..日期格式参数含义说明 D 一周中的星期几 DAY 天的名字,使用空格填充到9个字符 DD 月中的第几天 DDD 年中的第几天 DY 天的简写名 IW ISO标准的年中的第几周 IYYY ISO标准的四位年份 YYYY 四位年份 YYY,YY,Y 年份的最后三位,两位,一位 HH 小时,按12小时计 HH24 小时,按24小时计 MI 分 SS 秒 MM 月 Mon 月份的简写 Month 月份的全名 W 该月的第几个星期 WW 年中的第几个星期 1.日期时间间隔操作 当前时间减去7分钟的时间 selectsysdate,sysdate - interval ’7’ MINUTE from dual 当前时间减去7小时的时间 selectsysdate - interval ’7’ hour from dual 当前时间减去7天的时间 selectsysdate - interval ’7’ day from dual 当前时间减去7月的时间 selectsysdate,sysdate - interval ’7’ month from dual 当前时间减去7年的时间 selectsysdate,sysdate - interval ’7’ year from dual 时间间隔乘以一个数字 select sysdate,sysdate - 8 *interval ’2’ hour from dual

【VB】Format 格式化日期时间数字函数详解

【VB】Format 格式化日期时间数字函数详解 VB 中Format 格式化日期时间、数字函数功能详解: VB 格式化日期时间:MsgBox Format$(Now, "c") '2006-5-25 14:56:05 Format[$] (expr[,fmt]) format 返回变体型 format$ 强制返回为文本 -------------------------------- 数字类型的格式化 -------------------------------- 固定格式参数: General Number 普通数字,如可以用来去掉千位分隔号 format$("100,123.12","General Number") 返回值100123.12 Currency 货币类型,可添加千位分隔号和货币符号 format$("100123.12","Currency") 返回值¥100,123.12 Fixed 格式为带两位小数的数字 format$("100123","Fixed") 返回值100123.00 Standard 标准,即带千位分隔号和两位小数 format$("100123","Standard") 返回值100,123.00 Percent 百分数 format$("100123","Percent") 返回值10012300.00% Scientific 科学记数法 format$("100123","Scientific") 返回值1.00E+05 Yes/No 当值为0时返回NO,否则返回YES format$("100123","Yes/No") 返回值Yes True/False 当值为0时返回False,否则返回True format$("100123","True/False") 返回值True On/Off 当值为0时返回Off,否则返回On format$("100123","Yes/No") 返回值On 自定义格式参数 "" 不进行格式化返回值原值 0 占位格式化,不足补0 format$("100123","0000000") 返回值0100123 # 占位格式化,不足时不补0 format$("100123","#######") 返回值100123 . 强制显示小数点 format$("100123.12",".000") 返回值100123.120 % 转化为百分数,一个%代表乘以100 format$("10.23","0.00%") 返回值1023.00% format$("10.23","0.00%%") 返回值102300.00%% , 以千为单位格化 format$("10.23",",") 返回值0 format$("10010.23",",") 返回值10 format$("10010.23",",0.00") 返回值10.01

时间格式化function

UNCTION i056_set_docno_format(ps_field) DEFINE ps_field STRING DEFINE lwin_curr ui.Window DEFINE lfrm_curr ui.Form DEFINE lnode_item om.DomNode DEFINE lnode_child om.DomNode DEFINE ls_picture STRING # 單據編號格式設定 DEFINE li_i LIKE type_file.num10 #No.FUN-690005 INTEGER DEFINE ls_tabname STRING #No.FUN-720042 #No.FUN-A30020 --start-- DEFINE ls_sql STRING DEFINE lc_plantadd LIKE aza_file.aza97 DEFINE li_plantlen LIKE aza_file.aza98 #No.FUN-A30020 ---end--- LET lwin_curr = ui.Window.getCurrent() LET lfrm_curr = lwin_curr.getForm() IF lfrm_curr IS NULL THEN RETURN END IF LET ls_tabname = cl_get_table_name(ps_field) #No.FUN-720042 LET lnode_item = lfrm_curr.findNode("FormField",ls_tabname||"."||ps_field) #No.FUN-720042 IF lnode_item IS NULL THEN LET lnode_item = lfrm_curr.findNode("TableColumn",ls_tabname||"."||ps_field) #No.FUN-720042 IF lnode_item IS NULL THEN LET lnode_item = lfrm_curr.findNode("Matrix",ls_tabname||"."||ps_field) #FUN-A70010 IF lnode_item IS NULL THEN RETURN END IF END IF END IF LET lnode_child = lnode_item.getFirstChild() #需要改动的为以下4行 FOR li_i = 1 TO 2 LET ls_picture = ls_picture,"X" x输入任意字符 END FOR LET ls_picture = ls_picture,":",ls_picture 前面输入2位然后:,然后再输入两位

判断日期格式 ---JAVA

/** * 正则表达式验证日期格式 * @param args */ public static void main(String[] args) { String checkValue = "2007-02-29"; //String eL = "^((((1[6-9]|[2-9]\\d)\\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\\d|3[01]))|(((1[6-9]|[2 -9]\\d)\\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\\d|30))|(((1[6-9]|[2-9]\\d)\\d{ 2})-0?2-(0?[1-9]|1\\d|2[0-8]))|(((1[6-9]|[2-9]\\d)(0[48]|[2468][048]|[13579][26])|((1 6|[2468][048]|[3579][26])00))-0?2-29-)) (20|21|22|23|[0-1]?\\d):[0-5]?\\d:[0-5]?\\d$"; String eL= "^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\ \s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0 -9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([1 3579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][ 0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\ /\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))"; Pattern p = https://www.wendangku.net/doc/c115012618.html,pile(eL); Matcher m = p.matcher(checkValue); boolean b = m.matches(); if(b) { System.out.println("格式正确"); } else { System.out.println("格式错误"); } }

c日期格式化

C#日期格式化 DataFormatString="{0:yyyy-MM-dd 17:00:00}" Convert.ToDateTime("2008-05-06" + " 23:59:59") C#日期格式化1、绑定时格式化日期方法: <ASP:BOUNDCOLUMN DATAFIELD= "JoinTime " DATAFORMATSTRING= "{0:yyyy-MM-dd} " > ITEMSTYLE WIDTH= "18% " > </ITEMSTYLE > </ASP:BOUNDCOLUMN > C#日期格式化2、数据控件如DataGrid/DataList等的件格式化日期方法: e.Item.Cell[0].Text = Convert.ToDateTime(e.Item.Cell[0].Text).ToShortDateStri ng(); C#日期格式化3、用String类转换日期显示格式: String.Format( "yyyy-MM-dd ",yourDateTime); C#日期格式化4、用Convert方法转换日期显示格式: yyyy-MM-dd HH:mm:ss 24小时制yyyy-MM-dd hh:mm:ss 12小时制

Convert.ToDateTime("2005-8-23").ToString("yyMMdd",Sy stem.Globalization.DateTimeFormatInfo.InvariantInfo); //支持繁体数据库 C#日期格式化5、直接用ToString方法转换日期显示格式: DateTime.Now.ToString("yyyyMMddhhmmss"); DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss") C#日期格式化6、只显示年月 DateTime.Now.ToString("yyyyMMddhhmmss"); DateTime.Now.ToString("yyyy/MM/dd hh:mm:ss") C#日期格式化7、显示时间所有部分,包括:年月日时分秒 <asp:BoundColumn DataField="收款时间" HeaderText="收款时间" DataFormatString="{0:yyyy-MM-dd HH24:mm:ss}"> </asp:BoundColumn> C#日期格式化8、隐藏代码: protected string CutTime (object time) { System.DateTime currentTime = new System.DateTime(); return

C# 时间输出格式详细

c# DateTime.ToString("yyyy-MM-DD") 需要用DateTime的时候在把STRING换回DateTime ================================================================= https://www.wendangku.net/doc/c115012618.html,日期字符串格式化显示--DateTime.ToString()用法详解 我们经常会遇到对时间进行转换,达到不同的显示效果,默认格式为:2006-6-6 14:33:34 如果要换成成200606,06-2006,2006-6-6或更多的格式该怎么办呢? 这里将要用到:DateTime.ToString的方法(String, IFormatProvider) 示例: using System; using System.Globalization; String format="D"; DateTime date=DataTime.Now; Response.Write(date.ToString(format, DateTimeFormatInfo.InvariantInfo)); 结果输出 Thursday, June 16, 2006 在这里列出了参数format格式详细用法 =======================

格式字符关联属性/说明 d ShortDatePattern D LongDatePattern f 完整日期和时间(长日期和短时间) F FullDateTimePattern(长日期和长时间) g 常规(短日期和短时间) G 常规(短日期和长时间) m、M MonthDayPattern r、R RFC1123Pattern s 使用当地时间的 SortableDateTimePattern(基于 ISO 8601) t ShortTimePattern T LongTimePattern u UniversalSortableDateTimePattern 用于显示通用时间的格式 U 使用通用时间的完整日期和时间(长日期和长时间) y、Y YearMonthPattern 下表列出了可被合并以构造自定义模式的模式 ======================================== 这些模式是区分大小写的;例如,识别“MM”,但不识别“mm”。如果自定义模式包含空白字符或用单引号括起来的字符,则输出字符串页也将包含这些字符。未定义为格式模式的一部分或未定义为格式字符的字符按其原义复制。 格式模式说明: d 月中的某一天。一位数的日期没有前导零。 dd 月中的某一天。一位数的日期有一个前导零。 ddd 周中某天的缩写名称,在 AbbreviatedDayNames 中定义。

自定义格式中的时间和日期

自定义格式中的时间和日期 自定义格式中的日期和时间 在excel的数字格式中,“自定义”类型允许用户创建和使用符合一定规则的数字格式,应用于数值或文本数据上,以改变数据的显示方式。和其他内置的数字格式相同,应用了自定义的数字格式并不会改变数据本身的数值,仅仅是显示方式上的改变,不会影响数据的类型。今天就来说说自定义格式中的日期和时间代码。 自定义格式代码输入"=NOW()"及显示 G/通用格式41997.3329 常规格式显示日期 yyyy 2014 4位年份 yy 14 两位年份 [DBNum2][$-804] e"年"mm"月"dd"日"贰零壹肆年壹拾贰月贰拾肆日大写中文日期 bb 57 2位数佛历 公元前544元是佛历元年 bbbb 2557 4位数佛历 [$-804]mmmmm 十 中文月份,"一~十二" [$-804]mmmm 十二月 中文月份,"一月~十二月" mmmmm D 英文月份首字母

mmmm December 英文月份全拼 mmm Dec 英文月份缩写 mm 12 2位数月份 01~12 m 12 1位数月份 1~12 dddd Wednesday 英文星期全拼 ddd Wed 英文星期缩写 dd 24 2位数日期 01~31 d 24 1位数日期 1~31 aaaa 星期三 中文星期 星期一~日 aaa 三 中文星期 一~日 [$-804]e 2014 4位年份 0000-00-00输入20141226 结果为 2014-12-26 以年月日形式显示8位数 h 7

显示小时,1显示为1 hh 7 显示小时,1显示为01 h:mm:ss 7:59:25显示时间 mmmm,dd yyyy, aaaa ,hh:mm:ss AM/PM December,24 2014, 星期三 ,07:59:25 AM [m]479 显示分钟数,m,mm显示分钟,需跟在H后,或S 前 [h]7 [H][M][S]显示超出进制的时间,如大于24小时数,大于60的分钟数或秒数 s 25 显示秒,1显示为1 ss 25 显示秒,1显示为01 上午/下午hh"小""时"mm"分"ss"秒"上午07小时59分25秒12小时制显示时间 h AM/PM 7:00 AM 12小时制显示时间 h:mm AM/PM7:59 AM hh\小时mm\分ss\秒07小时59分25秒

Java里面对日期格式的处理

Java里面对日期格式的处理 1.从数据库中查出一条带有date类型字段的记录,并对日期格式进行格式化。 import java.sql.Date; import java.text.SimpleDateFormat; public static void test() { Connection conn = null; Statement st = null; ResultSet rs = null; try { conn = JdbcUtil.getInstance().getConnection(); st = conn.createStatement(); String sql = "select birthday from user"; rs = st.executeQuery(sql); while(rs.next()) { //从数据库中拿到的date java.sql.Date d = rs.getDate(1); System.out.println(d); //按照自己定义的模式转换日期输出格式。 SimpleDateFormat sdf = new SimpleDateFormat( "yyyy年-MM月-dd日"); System.out.println(sdf.format(d)); } } catch (SQLException e) { e.printStackTrace(); } finally { JdbcUtil.getInstance().release(conn, st, rs); } } 以上程序输出结果: 1984-02-28 1984年-02月-28日 2.从数据库中查出一条带有date类型字段的记录,并拿到该日期的月份。 public static void test() { Connection conn = null; Statement st = null; ResultSet rs = null; try { conn = JdbcUtil.getInstance().getConnection(); st = conn.createStatement(); String sql = "select birthday from user"; rs = st.executeQuery(sql); while(rs.next()) { java.sql.Date d = rs.getDate(1); System.out.println(d); //Calendar类是对date类的拓展,date类也有getMonth的 方法,但是过时了。 //以下方式拿到的Calendar对象是以当前系统时间的 date对象作为封装的。 Calendar c = Calendar.getInstance(); //以下方法是使用给定的Date设置此Calendar的时间。

相关文档